CPKIFEncryptedContentInfo Class Reference

#include <EncryptedContentInfo.h>

Collaboration diagram for CPKIFEncryptedContentInfo:

Collaboration graph
[legend]

List of all members.


Detailed Description

This class is used to prepare information for encryption and encapsulation in either a CMS EncryptedData or EnvelopedData object. An instance of this class is created and populated then passed to the SetDataToEncrypt function on either a CPKIFEncrytpedData or CPKIFEnvelopedData object. This class is not used to retrieve decrypted information from a CMS EncryptedData or EnvelopedData message. Instead, the Decrypt function of CPKIFEncryptedData or CPKIFEnvelopedData returns a buffer.

TSP-enforcing: Yes

Definition at line 26 of file EncryptedContentInfo.h.


Public Member Functions

 CPKIFEncryptedContentInfo ()
virtual ~CPKIFEncryptedContentInfo ()
void SetOID (CPKIFOIDPtr &oid)
CPKIFOIDPtr GetOID () const
void SetContent (CPKIFBufferPtr &buf)
CPKIFBufferPtr GetContent () const
void SetAlgorithmIdentifier (CPKIFAlgorithmIdentifierPtr &algID)
CPKIFAlgorithmIdentifierPtr GetAlgorithmIdentifier ()

Constructor & Destructor Documentation

CPKIFEncryptedContentInfo::CPKIFEncryptedContentInfo (  ) 

Interface: External

This function creates an instance of CPKIFEncryptedContentInfo and initializes the value of the OID property of a CPKIFEncryptedContentInfo object to g_data.

Returns:
None

Definition at line 34 of file EncryptedContentInfo.cpp.

References g_data.

CPKIFEncryptedContentInfo::~CPKIFEncryptedContentInfo (  )  [virtual]

Interface: External

This function destroys an instance of CPKIFEncryptedContentInfo.

Returns:
None

Definition at line 46 of file EncryptedContentInfo.cpp.


Member Function Documentation

void CPKIFEncryptedContentInfo::SetOID ( CPKIFOIDPtr &  oid  ) 

Interface: External

This function is used to specify the object OID value that identifies the type of payload encapsulated by the content info structure. PKIF provides variables that define the common CMS-related OIDs, such as g_data. By default, the value of this property is set to g_data. If SetOID is invoked with the oid parameter containing a NULL pointer, a CPKIFMessageException with error code set to COMMON_INVALID_INPUT will be thrown.

Returns:
None
Exceptions:
CPKIFMessageException(COMMON_INVALID_INPUT) 
Parameters:
oid  [in] Reference to a smart pointer to a CPKIFOID object containing the OID value identifying the content passed to SetContent

Definition at line 63 of file EncryptedContentInfo.cpp.

References COMMON_INVALID_INPUT, and TOOLKIT_MESSAGE.

CPKIFOIDPtr CPKIFEncryptedContentInfo::GetOID (  )  const

Interface: External

The GetOID function returns a smart pointer to a CPKIFOID object containing the value of the OID property. The value will point to the OID value passed by the application to SetOID or the value retrieved from a decoded EnvelopedData or EncryptedData message. If no value has been specified by the application or retrieved from a decoded EnvelopedData or EncryptedData message, the value returned will contain a NULL pointer.

Returns:
A smart pointer to a CPKIFOID object containing the value of the OID property.

Definition at line 84 of file EncryptedContentInfo.cpp.

void CPKIFEncryptedContentInfo::SetContent ( CPKIFBufferPtr &  buf  ) 

Interface: External

This function is used to set the content included in an EncryptedContentInfo structure within a CMS message. To specify the type of the content, use the SetOID function.

Returns:
None
Exceptions:
CPKIFMessageException(COMMON_INVALID_INPUT) 
Parameters:
buf  [in] Reference to smart pointer to a CPKIFBuffer object containing the buffer to be encrypted and encapsulated in an EncryptedData or EnvelopedData message.

Definition at line 98 of file EncryptedContentInfo.cpp.

References COMMON_INVALID_INPUT, and TOOLKIT_MESSAGE.

CPKIFBufferPtr CPKIFEncryptedContentInfo::GetContent (  )  const

Interface: External

This function is used to get the content included in an EncryptedContentInfo structure within a CMS message. To retrieve the type of the content, use the GetOID function.

The GetContent function returns a smart pointer to a CPKIFBuffer object containing the value of the Content property. The value will point to the content passed by the application to SetContent or the value retrieved from a decoded and decrypted EnvelopedData or EncryptedData message. If no value has been specified by the application or retrieved from a decoded EnvelopedData or EncryptedData message, the value returned will contain a NULL pointer.

Returns:
A smart pointer to a CPKIFBuffer object containing the value of the Content property.

Definition at line 123 of file EncryptedContentInfo.cpp.

void CPKIFEncryptedContentInfo::SetAlgorithmIdentifier ( CPKIFAlgorithmIdentifierPtr &  algID  ) 

Interface: External

This function is used to set the algorithm identifier that identifies the algorithm with which the payload specified by a call to SetContent should be encrypted. If SetAlgorithmIdentifier is invoked with the algID parameter containing a NULL pointer, a CPKIFMessageException with error code set to COMMON_INVALID_INPUT will be thrown. Currently only Triple DES CBC, which can be specified using the g_tdesCBC global variable,is supported.

The SetAlgorithmIdentifier function only sets the value of the AlgorithmIdentifier property of a CPKIFEncryptedContentInfo object. It does not indicate how the associated payload will be encrypted. The encryption algorithm is established by calling SetAlgorithmAndMode function on a CPKIFEnvelopedData object or by specifying the algorithm and mode on a CPKIFKeyMaterial object passed to a CPKIFEnvelopedData object

Returns:
None
Exceptions:
CPKIFMessageException(COMMON_INVALID_INPUT) 
Parameters:
algID  [in] Reference to a smart pointer to a CPKIFAlgorithmIdentifier object containing the algorithm identifier value to use when encrypting the associated content

Definition at line 145 of file EncryptedContentInfo.cpp.

References COMMON_INVALID_INPUT, and TOOLKIT_MESSAGE.

CPKIFAlgorithmIdentifierPtr CPKIFEncryptedContentInfo::GetAlgorithmIdentifier (  ) 

Interface: External

The GetAlgorithmIdentifier function returns a smart pointer to a CPKIFAlgorithmIdentifier object containing either the algorithm identifier specified by calling SetAlgorithmIdentifier or the value parsed from an encoded EncryptedContentInfo object.

Returns:
A smart pointer to a CPKIFAlgorithmIdentifier object

Definition at line 165 of file EncryptedContentInfo.cpp.


The documentation for this class was generated from the following files:

Generated on Mon Nov 15 11:20:14 2010 for PublicKeyInfrastructureFramework(PKIF) by  doxygen 1.5.6