#include <cert.h>
Collaboration diagram for CMS1:

Sample code illustrating the use of this class appears in the Cookbook section IETF Cryptographic Message Syntax (CMS).
Public Member Functions | |
Object Reuse and Initialization | |
| void | clear () |
| Clear this object. | |
| int | load (const str &b) |
| Load a CMS PDU into this object. | |
Predicates | |
| bool | isEnveloped () const |
| Predicate used to determine whether this object contains a CMS EnvelopedData PDU (i.e., is encrypted). | |
Encryption and Decryption | |
| int | encrypt (const str &session, const str &iv, const str &msg, int ncipher=0) |
| Encrypt specified data with this object and specified session key. | |
| int | decrypt (const str &recip, const str &oid, const str &prv) |
| Decrypt the contents of this object using a specified private key. | |
| int | decrypt (const str &recip, const str &oid, tokenop &t1) |
| Decrypt the contents of this object using the supplied callback function. | |
Inspectors | |
| str | make () const |
| Create an ASN.1 DER-encoded PDU representing this object. | |
Decrypt the contents of this object using the supplied callback function.
| recip | the recipient's certificate | |
| oid | an OID specifying the type of the recipient's private key (required only if t1.privatekey is used; not required if callback used). | |
| t1 | a properly filled out tokenop structure for decrypt operations. |
Decrypt the contents of this object using a specified private key.
| recip | the recipient's certificate | |
| oid | an OID specifying the type of the recipient's private key | |
| prv | the recipient's private key |
Encrypt specified data with this object and specified session key.
| session | the 24-byte TDES session key | |
| iv | the IV to use in CBC mode | |
| msg | the data to be encrypted | |
| ncipher | is the cipher to use 0 = TDES, 1 = AES (size based on key length) |
| str make | ( | ) | const |
Create an ASN.1 DER-encoded PDU representing this object.
| ISC Cryptographic Development Kit - User's Guide | |
| Questions? E-mail ISC technical support | |
| Copyright© 2002-2006 Information Security Corp. All rights reserved. |