CMS1 Struct Reference

#include <cert.h>

Collaboration diagram for CMS1:

Collaboration graph

Detailed Description

Data type used for in-memory PKCS #7 operations (RFC 3852 CMS).

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.


Member Function Documentation

int decrypt ( const str recip,
const str oid,
tokenop t1 
)

Decrypt the contents of this object using the supplied callback function.

Parameters:
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.
Returns:
0 (success) or nonzero (failure)
Remarks:
Only the first recipient of the EnvelopedData PDU is matched by this function.

int decrypt ( const str recip,
const str oid,
const str prv 
)

Decrypt the contents of this object using a specified private key.

Parameters:
recip the recipient's certificate
oid an OID specifying the type of the recipient's private key
prv the recipient's private key
Returns:
0 (success) or nonzero (failure)
Remarks:
Only the first recipient of the EnvelopedData PDU is matched by this function.

int encrypt ( const str session,
const str iv,
const str msg,
int  ncipher = 0 
)

Encrypt specified data with this object and specified session key.

Parameters:
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)
Remarks:
This function produces the ingredients for an EnvelopedData PDU in several internal buffers. You must call make() to obtain a string representation of the final EnvelopedData PDU.

str make (  )  const

Create an ASN.1 DER-encoded PDU representing this object.

Remarks:
This function takes the ingredients for an EnvelopedData or SignedData PDU from its internal buffers and produces a string representation of the final CMS PDU.


The documentation for this struct was generated from the following file:
ISC Cryptographic Development Kit - User's Guide
ISC website
Questions? E-mail ISC technical support
Copyright© 2002-2006 Information Security Corp. All rights reserved.