CPKIFContentInfo Class Reference

#include <ContentInfo.h>

Inheritance diagram for CPKIFContentInfo:

Inheritance graph
[legend]
Collaboration diagram for CPKIFContentInfo:

Collaboration graph
[legend]

List of all members.


Detailed Description

The CPKIFContentInfo class is used to create and parse the outer wrapper associated with all CMS messages. When creating signed or encrypted messages, a content info wrapper around the signed or encrypted payload must be created. When processing signed or encrypted messages, a content info wrapper must be decoded to access the signed or encrypted payload. The ContentInfo layer includes type information in the form of an OID, which is used to guide parsing of the payload.

TSP-enforcing: No

Definition at line 28 of file ContentInfo.h.


Public Member Functions

 CPKIFContentInfo ()
 CPKIFContentInfo (const CPKIFOIDPtr &oid, const CPKIFBufferPtr &ciBuf)
virtual ~CPKIFContentInfo ()
void SetContentType (CPKIFOIDPtr &contentType)
CPKIFOIDPtr GetContentType () const
void SetContent (CPKIFBufferPtr &content)
CPKIFBufferPtr GetContent () const
CPKIFBufferPtr Encode ()
void Decode (CPKIFBufferPtr &buf)
void Decode (const unsigned char *buf, int bufLen)

Friends

struct CPKIFContentInfoImpl

Constructor & Destructor Documentation

CPKIFContentInfo::CPKIFContentInfo (  ) 

Interface: External

Default constructor

Returns:
None

Definition at line 36 of file CACContentInfo.cpp.

References g_contentInfo, LOG_STRING_DEBUG, SetContentType(), and TOOLKIT_MESSAGE_CONTENT_INFO.

CPKIFContentInfo::CPKIFContentInfo ( const CPKIFOIDPtr &  oid,
const CPKIFBufferPtr &  ciBuf 
)

Interface: External

This constructor takes a reference to a CACCMSContentInfo and is invoked when parsing a CMS message containing attributes.

Returns:
None
Parameters:
oid  [in] the OID
ciBuf  [in] An internal representation of a content info to parse

Definition at line 66 of file CACContentInfo.cpp.

References LOG_STRING_DEBUG, and TOOLKIT_MESSAGE_CONTENT_INFO.

CPKIFContentInfo::~CPKIFContentInfo (  )  [virtual]

Interface: External

Returns:
None

Definition at line 49 of file CACContentInfo.cpp.

References LOG_STRING_DEBUG, and TOOLKIT_MESSAGE_CONTENT_INFO.


Member Function Documentation

void CPKIFContentInfo::SetContentType ( CPKIFOIDPtr &  contentType  ) 

Interface: External

This constructor takes a reference to a CACCMSContentInfo and is invoked when parsing a CMS message containing attributes.

Returns:
None Interface: External
This function is used to set the OID that identifies the type of payload encapsulated by the content info structure. PKIF provides global variables (declared in PKIFUTILS\ToolkitUtils.h) that define the supported CMS-defined message types: g_data, g_signedData or g_envelopedData. PKIF also defines OIDs that signify TSP content types: g_tstInfo and g_tsReq.

Returns:
None
Parameters:
contentType  [in] The content type to set.

Definition at line 112 of file CACContentInfo.cpp.

Referenced by CPKIFScvpPathBuildAndValidate::BuildAndValidatePath(), CPKIFScvpPathBuild::BuildPath(), CPKIFContentInfo(), and IPKIFScvpClient::FetchValPol().

CPKIFOIDPtr CPKIFContentInfo::GetContentType (  )  const [virtual]

Interface: External

This function is used to get the OID that identifies the type of payload encapsulated by the content info structure. PKIF provides global variables (declared in PKIFUTILS\ToolkitUtils.h) that define the supported CMS-defined message types: g_data, g_signedData or g_envelopedData. PKIF also defines OIDs that signify TSP content types: g_tstInfo and g_tsReq.

Returns:
A smart poiter to CPKIFOID object.

Reimplemented from CPKIFContentType.

Definition at line 128 of file CACContentInfo.cpp.

Referenced by VerifyResponseSignature().

void CPKIFContentInfo::SetContent ( CPKIFBufferPtr &  content  ) 

Interface: External

This function is used to set the encoded content contained by the content info structure. Typically, the content will be parsed based on the content type contained in a ContentInfo.

Returns:
None
Parameters:
content  [in] The encoded content to set

Definition at line 140 of file CACContentInfo.cpp.

Referenced by CPKIFScvpPathBuildAndValidate::BuildAndValidatePath(), CPKIFScvpPathBuild::BuildPath(), and IPKIFScvpClient::FetchValPol().

CPKIFBufferPtr CPKIFContentInfo::GetContent (  )  const [virtual]

Interface: External

This function is used to get/set the encoded content contained by the content info structure. Typically, the content will be parsed based on the content type contained in a ContentInfo.

Returns:
A smart poiter to CPKIFBuffer object

Reimplemented from CPKIFContentType.

Definition at line 154 of file CACContentInfo.cpp.

Referenced by VerifyResponseSignature().

CPKIFBufferPtr CPKIFContentInfo::Encode (  )  [virtual]

Interface: External

This function is used to encode the OID and content associated by calls to SetContent and SetContentType. The encoded result is returned in a smart pointer to a CPKIFBuffer object. This function may generate an exception containing one of the following error codes MSG_INCOMPLETE or MSG_ENCODE_FAILED.

Returns:
None
Exceptions:
CPKIFMessageException(MSG_INCOMPLETE) 
CPKIFMessageException(MSG_DECODE_FAILED) 

Implements CPKIFContentType.

Definition at line 284 of file CACContentInfo.cpp.

References CACASNWRAPPER_CREATE, ConvertStringToASN1OBJID(), CopyOID(), data, LOG_STRING_DEBUG, MSG_ENCODE_FAILED, MSG_INCOMPLETE, CPKIFException::push_info(), and TOOLKIT_MESSAGE_CONTENT_INFO.

Referenced by CPKIFScvpPathBuildAndValidate::BuildAndValidatePath(), CPKIFScvpPathBuild::BuildPath(), and IPKIFScvpClient::FetchValPol().

void CPKIFContentInfo::Decode ( CPKIFBufferPtr &  buf  )  [virtual]

Interface: External

This function is used to decode an encoded contentinfo.

Returns:
None
Parameters:
buf  [in] A reference to a smart pointer to CPKIFBuffer object containing encoded content info

Implements CPKIFContentType.

Definition at line 261 of file CACContentInfo.cpp.

References COMMON_INVALID_INPUT.

Referenced by VerifyResponseSignature().

void CPKIFContentInfo::Decode ( const unsigned char *  buf,
int  bufLen 
)

Interface: External

This function is used to decode a buffer containing an encoded content info blob. Following invocation of this function, the content is available by calling GetContent and the content type is available by calling GetContentType. If a message cannot be decoded, an exception with the error code MSG_DECODE_FAILED will be thrown.

Returns:
None
Exceptions:
CPKIFMessageException(MSG_DECODE_FAILED) 
CPKIFMessageException(COMMON_INVALID_INPUT) 
Parameters:
buf  [in] The input content info blob to decode.
bufLen  [in] The length of buf.

Definition at line 171 of file CACContentInfo.cpp.

References COMMON_INVALID_INPUT, CPKIFASNWrapper< T >::data(), CPKIFASNWrapper< T >::Decode(), LOG_STRING_DEBUG, MSG_DECODE_FAILED, PEMDecode(), CPKIFException::push_info(), and TOOLKIT_MESSAGE_CONTENT_INFO.


Friends And Related Function Documentation

friend struct CPKIFContentInfoImpl [friend]

Definition at line 30 of file ContentInfo.h.


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

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