#include <ContentInfo.h>
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 |
CPKIFContentInfo::CPKIFContentInfo | ( | ) |
Interface: External
Default constructor
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.
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
Definition at line 49 of file CACContentInfo.cpp.
References LOG_STRING_DEBUG, and TOOLKIT_MESSAGE_CONTENT_INFO.
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.
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.
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.
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.
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.
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.
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.
CPKIFMessageException(MSG_DECODE_FAILED) | ||
CPKIFMessageException(COMMON_INVALID_INPUT) |
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.
friend struct CPKIFContentInfoImpl [friend] |
Definition at line 30 of file ContentInfo.h.