CPKIFAttribute Class Reference

#include <Attribute.h>

Inheritance diagram for CPKIFAttribute:

Inheritance graph
[legend]
Collaboration diagram for CPKIFAttribute:

Collaboration graph
[legend]

List of all members.


Detailed Description

This class is the base class for all CMS attributes and provides a means for applications to define handlers for attributes not recognized by PKIF. See CPKIFSignerInfo::getSignedAttribute for an example of retrieving attributes from a CMS message. Note this class defines some virtual member functions that subclasses must override.

TSP-enforcing: No

Definition at line 29 of file Attribute.h.


Public Member Functions

 CPKIFAttribute ()
 CPKIFAttribute (const CPKIFOIDPtr &oid, const CPKIFBufferPtr &attr)
 CPKIFAttribute (const CPKIFBufferPtr &attr)
virtual ~CPKIFAttribute ()
void SetOID (const CPKIFOIDPtr &oid)
virtual CPKIFOIDPtr GetOID () const
void AddValue (CPKIFBufferPtr &buf)
virtual void GetValues (CPKIFBufferList &values) const

Constructor & Destructor Documentation

CPKIFAttribute::CPKIFAttribute (  ) 

Interface: External

Default constructor

Returns:
None

Definition at line 78 of file Attribute.cpp.

References LOG_STRING_DEBUG, and TOOLKIT_MESSAGE_ASN.

CPKIFAttribute::CPKIFAttribute ( const CPKIFOIDPtr &  oid,
const CPKIFBufferPtr &  attr 
)

Interface: External

This constructor is invoked when parsing a CMS message containing attributes; this version will throw a std::bad_alloc exception if allocation of memory to hold the encoded attribute value fails.

Returns:
None
Exceptions:
std::bad_alloc Interface: External
Constructor for CPKIFAttribute class

Returns:
None
Parameters:
oid  [in] A reference to a smart pointer to CPKIFOID object which identifies the Attribute
attr  [in[] A reference to a smart pointer to CPKIFBuffer object containing the attribute value

Definition at line 118 of file Attribute.cpp.

References SetOID().

CPKIFAttribute::CPKIFAttribute ( const CPKIFBufferPtr &  attr  ) 

Interface: External

Constructor for CPKIFAttribute class

Returns:
None
Parameters:
attr  [in[] A reference to a smart pointer to CPKIFBuffer object containing the attribute value

Definition at line 137 of file Attribute.cpp.

CPKIFAttribute::~CPKIFAttribute (  )  [virtual]

Interface: External

This function is a virtual destructor to be overridden by subclasses.

Returns:
None

Definition at line 153 of file Attribute.cpp.

References LOG_STRING_DEBUG, and TOOLKIT_MESSAGE_ASN.


Member Function Documentation

void CPKIFAttribute::SetOID ( const CPKIFOIDPtr &  oid  ) 

Interface: External

This function is used to set the OID identifying the type of attribute contained by the object. PKIF provides global objects containing the object identifier associated with most common CMS attributes.

If the oid parameter contains a NULL pointer when SetOID is invoked, a CPKIFMessageException with error code COMMON_INVALID_INPUT is thrown

Returns:
None
Exceptions:
CPKIFMessageException(COMMON_INVALID_INPUT) 
Parameters:
oid  [in] A reference to a smart pointer to a CPKIFOID object containing the object identifier that identifies the type of attribute

Definition at line 177 of file Attribute.cpp.

References COMMON_INVALID_INPUT, LOG_STRING_DEBUG, TOOLKIT_MESSAGE, and TOOLKIT_MESSAGE_ASN.

Referenced by CPKIFAttribute().

CPKIFOIDPtr CPKIFAttribute::GetOID (  )  const [virtual]

Interface: External

This function is used to retrieve the OID identifying the type of attribute contained by the object. PKIF provides global objects containing the object identifier associated with most common CMS attributes.

Returns:
The GetOID function returns a smart pointer to a CPKIFOID object, which may contain a NULL pointer if no OID has been associated with the CPKIFAttribute instance.

Reimplemented in CPKIFBinarySigningTimeAttribute, CPKIFContentTypeAttribute, CPKIFCountersignatureAttribute, CPKIFMessageDigestAttribute, CPKIFSigningCertificateAttribute, CPKIFSigningTimeAttribute, and CPKIFTimestampAttribute.

Definition at line 198 of file Attribute.cpp.

void CPKIFAttribute::AddValue ( CPKIFBufferPtr &  buf  ) 

Interface: External

This function is used to set the value(s) of the attribute contained by the object. Not all attributes are permitted to have multiple values (none of the attributes for which classes have been provided with PKIF may have multiple values). When handling an unrecognized attribute, the DER-encoded value(s) of the attribute can be retrieved using GetValues.

If the buf parameter contains a NULL pointer when AddValue is invoked, a CPKIFMessageException with error code COMMON_INVALID_INPUT is thrown.

Returns:
None
Exceptions:
CPKIFMessageException(COMMON_INVALID_INPUT) 
Parameters:
buf  [in] An encoded value to add to the set of values associated with an attribute

Reimplemented in CPKIFCountersignatureAttribute.

Definition at line 218 of file Attribute.cpp.

References COMMON_INVALID_INPUT, LOG_STRING_DEBUG, TOOLKIT_MESSAGE, and TOOLKIT_MESSAGE_ASN.

void CPKIFAttribute::GetValues ( CPKIFBufferList values  )  const [virtual]

Interface: External

This function is used to retrieve the value(s) of the attribute contained by the object. Not all attributes are permitted to have multiple values (none of the attributes for which classes have been provided with PKIF may have multiple values). When handling an unrecognized attribute, the DER-encoded value(s) of the attribute can be retrieved using GetValues.

Returns:
None
Parameters:
values  [out] The list of values associated with an attribute

Reimplemented in CPKIFBinarySigningTimeAttribute, CPKIFContentTypeAttribute, CPKIFCountersignatureAttribute, CPKIFMessageDigestAttribute, CPKIFSigningCertificateAttribute, CPKIFSigningTimeAttribute, and CPKIFTimestampAttribute.

Definition at line 240 of file Attribute.cpp.

References LOG_STRING_DEBUG, and TOOLKIT_MESSAGE_ASN.


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

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