1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/MYCertGen.h Sun Apr 19 21:19:35 2009 -0700
1.3 @@ -0,0 +1,44 @@
1.4 +//
1.5 +// MYCertGen.h
1.6 +// MYCrypto
1.7 +//
1.8 +// Created by Jens Alfke on 4/3/09.
1.9 +// Copyright 2009 Jens Alfke. All rights reserved.
1.10 +//
1.11 +// Derived from ...
1.12 +
1.13 +#import <Foundation/Foundation.h>
1.14 +#import <Security/Security.h>
1.15 +
1.16 +@class MYPublicKey, MYPrivateKey, MYCertificate, MYIdentity;
1.17 +
1.18 +
1.19 +NSData* MYCertificateCreateTemplate(const CSSM_X509_NAME *subject, const CSSM_X509_NAME *issuer,
1.20 + NSDate *validFrom, NSDate *validTo,
1.21 + uint32_t serialNumber,
1.22 + const CSSM_X509_EXTENSION **extensions, unsigned nExtensions,
1.23 + MYPublicKey *publicKey,
1.24 + const CSSM_X509_ALGORITHM_IDENTIFIER *signingAlgorithm,
1.25 + CSSM_CL_HANDLE clHandle);
1.26 +
1.27 +NSData* MYCertificateSign(NSData *certificateTemplate,
1.28 + MYPrivateKey *privateKey,
1.29 + CSSM_ALGORITHMS signingAlgorithmID,
1.30 + CSSM_CL_HANDLE cssmCLHandle);
1.31 +
1.32 +MYCertificate *createCertificate(const CSSM_X509_NAME *subject, const CSSM_X509_NAME *issuer,
1.33 + NSDate *validFrom, NSDate *validTo,
1.34 + uint32_t serialNumber,
1.35 + const CSSM_X509_EXTENSION **extensions, unsigned nExtensions,
1.36 + MYPrivateKey *privateKey,
1.37 + const CSSM_X509_ALGORITHM_IDENTIFIER *signingAlgorithm,
1.38 + CSSM_ALGORITHMS signingAlgorithmID,
1.39 + CSSM_CL_HANDLE cssmCLHandle);
1.40 +
1.41 +CSSM_CL_HANDLE getCLHandle();
1.42 +
1.43 +
1.44 +MYCertificate* MYCertificateCreateSelfSigned(MYPrivateKey *privateKey,
1.45 + NSDictionary *attributes );
1.46 +MYIdentity* MYIdentityCreateSelfSigned(MYPrivateKey *privateKey,
1.47 + NSDictionary *attributes );