MYCertificateRequest Class Reference

A mutable, unsigned certificate that can be filled out and then signed by the issuer. More...

Inherits MYCertificateInfo.

List of all members.

Public Member Functions

(id) - initWithPublicKey:
 Initializes a blank instance which can be used to create a new certificate.
(NSData *) - requestData:
 Encodes the certificate request in X.509 format -- this is NOT a certificate! It has to be sent to a Certificate Authority to be signed.
(NSData *) - selfSignWithPrivateKey:error:
 Signs the certificate using the given private key, which must be the counterpart of the public key stored in the certificate, and returns the encoded certificate data.
(MYIdentity *) - createSelfSignedIdentityWithPrivateKey:error:
 Signs the certificate using the given private key, which must be the counterpart of the public key stored in the certificate; adds the certificate to the keychain; and returns a MYIdentity representing the paired certificate and private key.

Properties

NSDate * validFrom
 The date/time at which the certificate first becomes valid.
NSDate * validTo
 The date/time at which the certificate expires.

Detailed Description

A mutable, unsigned certificate that can be filled out and then signed by the issuer.

Used to generate an identity certificate for a key-pair.


Member Function Documentation

- (MYIdentity *) createSelfSignedIdentityWithPrivateKey: (MYPrivateKey*)  privateKey
error: (NSError**)  outError 

Signs the certificate using the given private key, which must be the counterpart of the public key stored in the certificate; adds the certificate to the keychain; and returns a MYIdentity representing the paired certificate and private key.

- (id) initWithPublicKey: (MYPublicKey*)  pubKey  

Initializes a blank instance which can be used to create a new certificate.

The certificate will not contain anything yet other than the public key. The desired attributes should be set, and then the -selfSignWithPrivateKey:error method called.

- (NSData *) requestData: (NSError**)  outError  

Encodes the certificate request in X.509 format -- this is NOT a certificate! It has to be sent to a Certificate Authority to be signed.

If you want to generate a self-signed certificate, use one of the self-signing methods instead.

- (NSData *) selfSignWithPrivateKey: (MYPrivateKey*)  privateKey
error: (NSError**)  outError 

Signs the certificate using the given private key, which must be the counterpart of the public key stored in the certificate, and returns the encoded certificate data.

The subject attributes will be copied to the issuer attributes. If no valid date range has been set yet, it will be set to a range of one year starting from the current time. A unique serial number based on the current time will be set.


Property Documentation

- (NSDate *) validFrom [read, write, retain]

The date/time at which the certificate first becomes valid.

Settable.

Reimplemented from MYCertificateInfo.

- (NSDate *) validTo [read, write, retain]

The date/time at which the certificate expires.

Settable

Reimplemented from MYCertificateInfo.


The documentation for this class was generated from the following files:
Generated on Sun Apr 17 12:23:58 2011 for MYCrypto by  doxygen 1.6.3