MYCertGen.h
author snej@snej.local
Tue Apr 14 18:34:52 2009 -0700 (2009-04-14)
changeset 11 3568d5fd4b6a
child 22 058394513f33
permissions -rw-r--r--
* The build process runs Doxygen only if it's installed (i.e. on the shell search path).
* Added instructions to the README on setting up a named Source Tree for MYUtilities.
* Changed the RSA key size in MYCryptoTest to 2048 and made it a named constant.
     1 //
     2 //  MYCertGen.h
     3 //  MYCrypto
     4 //
     5 //  Created by Jens Alfke on 4/3/09.
     6 //  Copyright 2009 Jens Alfke. All rights reserved.
     7 //
     8 //  Derived from ...
     9 
    10 #import <Foundation/Foundation.h>
    11 #import <Security/Security.h>
    12 
    13 @class MYPublicKey, MYPrivateKey, MYCertificate, MYIdentity;
    14 
    15 
    16 NSData* MYCertificateCreateTemplate(const CSSM_X509_NAME *subject, const CSSM_X509_NAME *issuer,
    17                                     NSDate *validFrom, NSDate *validTo,
    18                                     uint32_t serialNumber,
    19                                     const CSSM_X509_EXTENSION **extensions, unsigned nExtensions,
    20                                     MYPublicKey *publicKey,
    21                                     const CSSM_X509_ALGORITHM_IDENTIFIER *signingAlgorithm,
    22                                     CSSM_CL_HANDLE clHandle);
    23 
    24 NSData* MYCertificateSign(NSData *certificateTemplate, 
    25                           MYPrivateKey *privateKey, 
    26                           CSSM_ALGORITHMS signingAlgorithmID,
    27                           CSSM_CL_HANDLE cssmCLHandle);
    28 
    29 MYCertificate *createCertificate(const CSSM_X509_NAME *subject, const CSSM_X509_NAME *issuer,
    30                                  NSDate *validFrom, NSDate *validTo,
    31                                  uint32_t serialNumber,
    32                                  const CSSM_X509_EXTENSION **extensions, unsigned nExtensions,
    33                                  MYPrivateKey *privateKey, 
    34                                  const CSSM_X509_ALGORITHM_IDENTIFIER *signingAlgorithm,
    35                                  CSSM_ALGORITHMS signingAlgorithmID,
    36                                  CSSM_CL_HANDLE cssmCLHandle);
    37 
    38 CSSM_CL_HANDLE getCLHandle();
    39 
    40 
    41 MYCertificate* MYCertificateCreateSelfSigned(MYPrivateKey *privateKey,
    42                                              NSDictionary *attributes );
    43 MYIdentity* MYIdentityCreateSelfSigned(MYPrivateKey *privateKey,
    44                                        NSDictionary *attributes );