diff -r 1dfe820d7ebe -r dee779b84a95 MYPrivateKey.h --- a/MYPrivateKey.h Wed Apr 08 16:30:52 2009 -0700 +++ b/MYPrivateKey.h Thu Apr 09 22:47:11 2009 -0700 @@ -7,7 +7,7 @@ // #import "MYKey.h" -@class MYPublicKey, MYSHA1Digest; +@class MYPublicKey, MYSHA1Digest, MYIdentity; /** A private key, used for signing and decrypting data. @@ -48,6 +48,12 @@ //@{ #if !TARGET_OS_IPHONE +/** Creates a self-signed identity certificate using this key-pair. + The attributes describe the certificate's metadata, including its expiration date and the + subject's name. Keys for the dictionary are given below; the only mandatory one is + kMYIdentityCommonNameKey. */ +- (MYIdentity*) createSelfSignedIdentityWithAttributes: (NSDictionary*)attributes; + /** Exports the private key as a data blob, so that it can be stored as a backup, or transferred to another computer. Since the key is sensitive, it must be exported in encrypted form using a user-chosen passphrase. This method will display a standard alert panel, run by @@ -75,3 +81,14 @@ //@} @end + + +/* Attribute keys for creating identities: */ +#define kMYIdentityCommonNameKey @"Common Name" // NSString. Required! +#define kMYIdentityGivenNameKey @"Given Name" +#define kMYIdentitySurnameKey @"Surname" +#define kMYIdentityDescriptionKey @"Description" +#define kMYIdentityEmailAddressKey @"Email Address" +#define kMYIdentityValidFromKey @"Valid From" // NSDate. Defaults to the current date/time +#define kMYIdentityValidToKey @"Valid To" // NSDate. Defaults to one year from ValidFrom +#define kMYIdentitySerialNumberKey @"Serial Number" // NSNumber. Defaults to 1