MYDecoder Class Reference

Decodes a CMS-formatted message into the original data, and identifies & verifies signatures. More...

List of all members.

Public Member Functions

(id) - init
 Initializes a new decoder.
(id) - initWithData:error:
 Initializes a new decoder and reads the entire message data.
(BOOL) - useKeychain:
 Specifies a keychain to use to look up certificates and keys, instead of the default keychain search path.
(BOOL) - addData:
 Adds data to the decoder.
(BOOL) - finish
 Tells the decoder that all of the data has been read, after the last call to -addData:.

Properties

NSError * error
 The error, if any, that occurred while decoding the content.
NSData * detachedContent
 If the message content is detached (stored separately from the encoded message), you must copy it to this property before calling -finish, so that the decoder can use it to verify signatures.
NSData * content
 The decoded message content.
BOOL isSigned
 YES if the message was signed.
BOOL isEncrypted
 YES if the message was encrypted.
NSArray * signers
 An array of MYSigner objects representing the identities who signed the message.
NSArray * certificates
 All of the certificates (as MYCertificate objects) that were attached to the message.

Expert

Advanced methods.



CSSM_OID contentType
 The X.509 content-type of the message contents.
SecPolicyRef policy
 The Policy that will be used to evaluate trust when calling MYSigner.copyTrust.
(NSString *) - dump
 Returns a string with detailed information about the message metadata.

Detailed Description

Decodes a CMS-formatted message into the original data, and identifies & verifies signatures.


Member Function Documentation

- (BOOL) addData: (NSData*)  data  

Adds data to the decoder.

You can add the entire data at once, or in bits and pieces (if you're reading it from a stream).

- (NSString *) dump  

Returns a string with detailed information about the message metadata.

Not user-presentable; used for debugging.

- (BOOL) finish  

Tells the decoder that all of the data has been read, after the last call to -addData:.

You must call this before accessing the message content or metadata.

- (id) init  

Initializes a new decoder.

- (id) initWithData: (NSData*)  data
error: (NSError**)  outError 

Initializes a new decoder and reads the entire message data.

- (BOOL) useKeychain: (MYKeychain*)  keychain  

Specifies a keychain to use to look up certificates and keys, instead of the default keychain search path.


Property Documentation

- (NSArray *) certificates [read, assign]

All of the certificates (as MYCertificate objects) that were attached to the message.

- (NSData *) content [read, assign]

The decoded message content.

- (CSSM_OID) contentType [read, assign]

The X.509 content-type of the message contents.

The Data field points to autoreleased memory: do not free it yourself, and do not expect it to remain valid after the calling method returns.

- (NSData *) detachedContent [read, write, retain]

If the message content is detached (stored separately from the encoded message), you must copy it to this property before calling -finish, so that the decoder can use it to verify signatures.

- (NSError *) error [read, assign]

The error, if any, that occurred while decoding the content.

If -addData: returns NO, read this property to find out what went wrong. The most likely error is (NSOSStatusErrorDomain, errSecUnknownFormat).

- (BOOL) isEncrypted [read, assign]

YES if the message was encrypted.

- (BOOL) isSigned [read, assign]

YES if the message was signed.

(Use the signers property to see who signed it.)

- (SecPolicyRef) policy [read, write, assign]

The Policy that will be used to evaluate trust when calling MYSigner.copyTrust.

NULL by default.

- (NSArray *) signers [read, assign]

An array of MYSigner objects representing the identities who signed the message.

Nil if the message is unsigned.


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