CPKIFCMSAttributeMediator2 Class Reference

#include <PKIFCMSAttributeMediator2.h>

Inheritance diagram for CPKIFCMSAttributeMediator2:

Inheritance graph
[legend]
Collaboration diagram for CPKIFCMSAttributeMediator2:

Collaboration graph
[legend]

List of all members.


Detailed Description

The CPKIFCMSAttributeMediator2 is used to create CPKIFAttribute-derived objects of the appropriate subclass when attributes are present in a CPKIFSignerInfo or CPKIFEncryptedData object. The mediator’s getAttribute function identifies the appropriate colleague factory class to be used to construct to attribute. If no colleague factory class is found that can handle the attribute type (as identified by the attribute’s OID) when a virtual CPKIFAttribute will be returned.

TSP-enforcing: No

Definition at line 32 of file PKIFCMSAttributeMediator2.h.


Public Member Functions

 ~CPKIFCMSAttributeMediator2 ()
void Initialize (std::vector< CPKIFException * > *errorInfo=NULL)
void Terminate ()
CPKIFAttributePtr getAttribute (CPKIFOIDPtr oid, CPKIFBufferPtr buf)
void ParseAttributes (CPKIFBufferPtr &buf, std::vector< CPKIFAttributePtr > &attrVector)
void ParseAttributes2 (CPKIFBufferPtr &buf, std::vector< CPKIFAttributePtr > &attrVector)
void AddColleague (IPKIFColleague *module, bool transferOwnership)

Static Public Member Functions

static CPKIFCMSAttributeMediator2GetInstance (void)

Constructor & Destructor Documentation

CPKIFCMSAttributeMediator2::~CPKIFCMSAttributeMediator2 ( void   ) 

Interface: External

This function destroys an instance of CPKIFCMSAttributeMediator2 including invocation of Terminate to clean up any associated colleagues.

Returns:
None

Definition at line 113 of file PKIFCMSAttributeMediator2.cpp.

References _ASSERT, LOG_STRING_DEBUG, Terminate(), and TOOLKIT_CRYPTO_MISC.


Member Function Documentation

CPKIFCMSAttributeMediator2 * CPKIFCMSAttributeMediator2::GetInstance ( void   )  [static]

void CPKIFCMSAttributeMediator2::Initialize ( std::vector< CPKIFException * > *  errorInfo = NULL  ) 

Interface: External

This function prepares an instance of CPKIFCMSAttributeMediator2 for use, including initialization of all runtime-associated mediators and colleagues. By default, all mediators catch and discard these exceptions and ignore the offending colleague. Applications can review the list of exceptions that occurred during initialization by passing a non-NULL pointer to a vector of CPKIFException objects. Any exception objects returned in the vector must be freed by the application.

Returns:
None
Exceptions:
CPKIFMessageException(COMMON_ALREADY_INITIALIZED) 
Parameters:
errorInfo  [out] Pointer to a vector of exception objects to receive exceptions thrown during initialization by associated colleague objects

Definition at line 160 of file PKIFCMSAttributeMediator2.cpp.

References IPKIFColleague::AddParent(), COMMON_ALREADY_INITIALIZED, IPKIFColleague::Initialize(), LOG_STRING_DEBUG, TOOLKIT_CRYPTO_MISC, and TOOLKIT_MESSAGE_ATTR_MEDIATOR.

Referenced by GetInstance().

void CPKIFCMSAttributeMediator2::Terminate (  )  [virtual]

Interface: External

This function de-initializes an instance of CPKIFCryptoMediator2 rendering it unusable until after a subsequent call to Initialize. Terminate will remove all mediator and colleague associations and will destroy any colleagues associated at runtime via AddColleague with transfer of ownership. This is called automatically by the destructor.

Returns:
None

Reimplemented from IPKIFColleague.

Definition at line 140 of file PKIFCMSAttributeMediator2.cpp.

Referenced by ~CPKIFCMSAttributeMediator2().

CPKIFAttributePtr CPKIFCMSAttributeMediator2::getAttribute ( CPKIFOIDPtr  oid,
CPKIFBufferPtr  buf 
)

Interface: External

This function takes a pointer to an Objective structure containing a CMS attribute and returns a pointer to a CPKIFAttribute (or derived) object containing the type and value from the attribute. The associated colleagues are invoked as appropriate when generating an object derived from CPKIFAttribute. If an attribute cannot be parsed, a CPKIFAttribute object containing the encoded attribute is returned.

Returns:
A smart pointer to a CPKIFAttribute (or derived) object containing the type and value from the attribute. Interface: External
This function takes a pointer to an Objective structure containing a CMS attribute and returns a pointer to a CPKIFAttribute (or derived) object containing the type and value from the attribute. The associated colleagues are invoked as appropriate when generating an object derived from CPKIFAttribute. If an attribute cannot be parsed, a CPKIFAttribute object containing the encoded attribute is returned.

Returns:
A smart pointer to a CPKIFAttribute (or derived) object containing the type and value from the attribute.
Parameters:
oid  [in] The OID of the CACCMSAttribute object
buf  [in] A buffer pointing to a unparsed CACCMSAttribute object

Definition at line 282 of file PKIFCMSAttributeMediator2.cpp.

References IPKIFCMSAttributeFactory::create(), LOG_STRING_DEBUG, IPKIFCMSAttributeFactory::refOID(), and TOOLKIT_CRYPTO_MISC.

void CPKIFCMSAttributeMediator2::ParseAttributes ( CPKIFBufferPtr &  buf,
std::vector< CPKIFAttributePtr > &  attrVector 
) [virtual]

Interface: External

This function takes a pointer to a buffer containing unencoded attributes. The function then decodes and parses the attributes, and their respective pointers to the vector parameter.

Returns:
None
Parameters:
buf  [in] pointer to a buffer of unencoded attributes
attrVector  [out] this vector will hold attribute ptrs, if any

Implements IPKIFParseAttributes.

Definition at line 328 of file PKIFCMSAttributeMediator2.cpp.

References CACASNWRAPPER_CREATE, and IPKIFCMSAttributeFactory::refOID().

void CPKIFCMSAttributeMediator2::ParseAttributes2 ( CPKIFBufferPtr &  buf,
std::vector< CPKIFAttributePtr > &  attrVector 
) [virtual]

Interface: External

This function takes a pointer to a buffer containing unencoded attributes for content with attributes trusture. The function then decodes and parses the attributes, and their respective pointers to the vector parameter.

Returns:
None
Parameters:
buf  [in] pointer to a buffer of unencoded attributes
attrVector  [out] this vector will hold attribute ptrs, if any

Implements IPKIFParseAttributes.

Definition at line 404 of file PKIFCMSAttributeMediator2.cpp.

References CACASNWRAPPER_CREATE, and IPKIFCMSAttributeFactory::refOID().

void CPKIFCMSAttributeMediator2::AddColleague ( IPKIFColleague module,
bool  transferOwnership 
)

Interface: External

This function add a colleague to the CPKIFCMSAttributeMediator2

Returns:
None
Parameters:
module  [in] Pointer to an IPKIFColleague object
transferOwnership  [in] Boolean value indicating whether the mediator should take ownership of the object passed as module for deletion purposes

Definition at line 478 of file PKIFCMSAttributeMediator2.cpp.

References IPKIFColleague::AddParent(), IPKIFColleague::Initialize(), LOG_STRING_DEBUG, and TOOLKIT_PATH_MEDIATOR.


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

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