IPKIFColleague Class Reference

#include <IPKIFColleague.h>

Inherited by CPKIFAiaOrSiaRetrieval, CPKIFAuthorityInfoAccessFactory, CPKIFAuthorityKeyIdentifierFactory, CPKIFBasicConstraintsFactory, CPKIFBinarySigningTimeAttributeFactory, CPKIFCacheMediator2, CPKIFCAPI2, CPKIFCAPICertUpdate2, CPKIFCAPICRLUpdate2, CPKIFCAPIRaw, CPKIFCAPIRepository2, CPKIFCAPITrustRootCRLRepository2, CPKIFCAPITrustStore2, CPKIFCAPIUserRepository2, CPKIFCertificateIssuerFactory, CPKIFCertStatusCache, CPKIFCMSAttributeMediator2, CPKIFCNGCAPI, CPKIFCNGCAPIRaw, CPKIFContentTypeAttributeFactory, CPKIFCountersignatureAttributeFactory, CPKIFCRLDistributionPointsFactory, CPKIFCRLDPRetrieval, CPKIFCRLNumberFactory, CPKIFCRLReasonFactory, CPKIFCRLStreamIdentifierFactory, CPKIFCryptoMediator2, CPKIFCryptoPP, CPKIFCryptoPPRaw, CPKIFDeltaCRLIndicatorFactory, CPKIFEmptyColleague, CPKIFEmptyMediator, CPKIFExtendedKeyUsageFactory, CPKIFFreshestCRLFactory, CPKIFHoldInstructionCodeFactory, CPKIFInhibitAnyPolicyFactory, CPKIFInvalidityDateFactory, CPKIFIssuerAltNameFactory, CPKIFIssuingDistributionPointFactory, CPKIFKeyUsageFactory, CPKIFLDAPRepository, CPKIFMessageDigestAttributeFactory, CPKIFNameConstraintsFactory, CPKIFNSS, CPKIFNSSAesKeyWrap, CPKIFNSSCertUpdate, CPKIFNSSCRLUpdate, CPKIFNSSRaw, CPKIFNSSRepository, CPKIFNSSTrustStore, CPKIFOCSPChecker, CPKIFPathBuildAndValidate, CPKIFPathBuilder2, CPKIFPathProcessingMediator2, CPKIFPathValidator2, CPKIFPolicyConstraintsFactory, CPKIFPolicyInformationSetFactory, CPKIFPolicyMappingsFactory, CPKIFPrivateKeyUsageFactory, CPKIFReversiblePathBuilder, CPKIFRevocationStatusMediator2, CPKIFScvpPathBuild, CPKIFScvpPathBuildAndValidate, CPKIFSigningCertificateAttributeFactory, CPKIFSigningTimeAttributeFactory, CPKIFSubjectAltNameFactory, CPKIFSubjectInfoAccessFactory, CPKIFSubjectKeyIdentifierFactory, CPKIFSynonymousSourceStore, CPKIFTimestampAttributeFactory, CPKIFX509CRLChecker, CPKIFX509ExtensionMediator2, SimpleCertCache, SimpleCRLCache, and SimpleRootStore.

Collaboration diagram for IPKIFColleague:

Collaboration graph
[legend]

List of all members.


Detailed Description

The IPKIFColleague class defines the interface that must be implemented by all colleague classes. It defines and implements the means by which the interactions between mediators and colleagues are managed. Applications do not directly exercise methods of this interface.

It also defines interfaces that must be implemented by mediator classes; the base class implementations will suffice for those colleagues that are not mediators.

TSP-enforcing: Yes

Definition at line 32 of file IPKIFColleague.h.


Public Member Functions

virtual void Initialize ()
 IPKIFColleague ()
virtual ~IPKIFColleague ()
void AddParent (IPKIFMediator *parent)
void RemoveParent (IPKIFMediator *parent)
bool IsParent (IPKIFMediator *) const
virtual void InitializeMediator (std::vector< CPKIFException * > *errorInfo=NULL)
virtual void Terminate ()
template<class X>
X * GetMediator () const
void AddMediator (IPKIFMediatorPtr &m)
void RemoveMediator (IPKIFMediator *)
void RemoveMediatorAssociations ()
template<class X>
X * GetMediator (std::vector< const IPKIFColleague * > *tree) const
void GetMediators (std::vector< IPKIFMediatorPtr > &v) const
template<class X>
X * FindMediator (const std::vector< IPKIFMediator * > &v, std::vector< const IPKIFColleague * > *tree) const
template<class X>
X * FindMediator (const std::vector< IPKIFMediatorPtr > &v, std::vector< const IPKIFColleague * > *tree) const
template<class X>
X * GetMediatorFromParent () const
template<class X>
X * GetMediatorFromParent (std::vector< const IPKIFColleague * > *tree) const

Protected Attributes

std::vector< IPKIFMediator * > m_parents
std::vector< IPKIFMediatorPtrm_mediators

Constructor & Destructor Documentation

IPKIFColleague::IPKIFColleague (  ) 

Interface: External

This function is the default constructor for IPKIFColleague objects.

Returns:
None

Definition at line 39 of file IPKIFColleague.cpp.

IPKIFColleague::~IPKIFColleague (  )  [virtual]

Interface: External

This function is the default destructor for IPKIFColleague objects.

Returns:
None

Definition at line 27 of file IPKIFColleague.cpp.

References Terminate().


Member Function Documentation

void IPKIFColleague::Initialize ( void   )  [virtual]

Interface: External

This function initializes a mediator object for use, including initialization of all associated colleagues. The errorInfo parameter can be used to collect exception objects thrown by colleagues during initialization. Colleagues that are not successfully initialized are ignored and the exception collected in the vector passed via errorInfo, if present.

Returns:
None

Reimplemented in CPKIFCryptoMediator2, CPKIFCAPI2, CPKIFCAPIRaw, CPKIFCNGCAPI, CPKIFCNGCAPIRaw, CPKIFCryptoPP, CPKIFCryptoPPRaw, CPKIFNSS, CPKIFNSSAesKeyWrap, CPKIFNSSRaw, CPKIFPathProcessingMediator2, CPKIFRevocationStatusMediator2, CPKIFPathBuildAndValidate, CPKIFPathBuilder2, CPKIFPathValidator2, CPKIFReversiblePathBuilder, CPKIFX509CRLChecker, CPKIFOCSPChecker, CPKIFCAPICertUpdate2, CPKIFCAPICRLUpdate2, CPKIFCAPITrustRootCRLRepository2, CPKIFAiaOrSiaRetrieval, CPKIFCacheMediator2, CPKIFCAPIRepository2, CPKIFCAPITrustStore2, CPKIFCAPIUserRepository2, CPKIFCRLDPRetrieval, CPKIFLDAPRepository, CPKIFNSSCertUpdate, CPKIFNSSCRLUpdate, CPKIFNSSRepository, CPKIFNSSTrustStore, CPKIFSynonymousSourceStore, SimpleCertCache, SimpleCRLCache, SimpleRootStore, CPKIFCertStatusCache, CPKIFEmptyColleague, CPKIFAuthorityInfoAccessFactory, CPKIFAuthorityKeyIdentifierFactory, CPKIFBasicConstraintsFactory, CPKIFCertificateIssuerFactory, CPKIFCRLDistributionPointsFactory, CPKIFCRLNumberFactory, CPKIFCRLReasonFactory, CPKIFCRLStreamIdentifierFactory, CPKIFDeltaCRLIndicatorFactory, CPKIFExtendedKeyUsageFactory, CPKIFFreshestCRLFactory, CPKIFHoldInstructionCodeFactory, CPKIFInhibitAnyPolicyFactory, CPKIFInvalidityDateFactory, CPKIFIssuerAltNameFactory, CPKIFIssuingDistributionPointFactory, CPKIFKeyUsageFactory, CPKIFNameConstraintsFactory, CPKIFPolicyConstraintsFactory, CPKIFPolicyInformationSetFactory, CPKIFPolicyMappingsFactory, CPKIFPrivateKeyUsageFactory, CPKIFSubjectAltNameFactory, CPKIFSubjectInfoAccessFactory, CPKIFSubjectKeyIdentifierFactory, CPKIFBinarySigningTimeAttributeFactory, CPKIFContentTypeAttributeFactory, CPKIFCountersignatureAttributeFactory, CPKIFMessageDigestAttributeFactory, CPKIFSigningCertificateAttributeFactory, CPKIFSigningTimeAttributeFactory, CPKIFTimestampAttributeFactory, CPKIFScvpPathBuild, and CPKIFScvpPathBuildAndValidate.

Definition at line 175 of file IPKIFColleague.cpp.

Referenced by CPKIFX509ExtensionMediator2::AddColleague(), CPKIFCMSAttributeMediator2::AddColleague(), CPKIFCMSAttributeMediator2::Initialize(), and CPKIFX509ExtensionMediator2::InitializeMediator().

void IPKIFColleague::AddParent ( IPKIFMediator p  ) 

Interface: External

This function is invoked by mediator objects when a colleague is added to the collection of colleagues associated with the mediator, i.e. via a call to AddColleague. It is invoked to notify the IPKIFColleague object that there is an association between the colleague object and the mediator object passed via p. The list of parents can be used to find pointers to interfaces and is used to notify related objects of the destruction of a colleague object.

Returns:
None
Parameters:
p  [in] Pointer to an IPKIFMediator object that functions as a parent of the IPKIFColleague object

Definition at line 55 of file IPKIFColleague.cpp.

References IsParent(), and m_parents.

Referenced by CPKIFX509ExtensionMediator2::AddColleague(), CPKIFCMSAttributeMediator2::AddColleague(), CPKIFCMSAttributeMediator2::Initialize(), and CPKIFX509ExtensionMediator2::InitializeMediator().

void IPKIFColleague::RemoveParent ( IPKIFMediator p  ) 

Interface: External

This function is called to remove the IPKIFMediator object passed via p from the list of parents held by a colleague.

Returns:
None
Parameters:
p  [in] Pointer to an IPKIFMediator object

Definition at line 76 of file IPKIFColleague.cpp.

References m_parents.

bool IPKIFColleague::IsParent ( IPKIFMediator p  )  const

Interface: External

This function returns true if the IPKIFMediator object passed via the p parameter is a parent of the IPKIFColleague object, i.e. if the AddParent function has been called with p as a parameter, and false otherwise.

Returns:
true if the IPKIFMediator object passed via the p parameter is a parent of the IPKIFColleague object.
Parameters:
p  [in] Pointer to an IPKIFMediator object for which a determination of parentage is sought

Definition at line 102 of file IPKIFColleague.cpp.

References m_parents.

Referenced by AddParent().

void IPKIFColleague::InitializeMediator ( std::vector< CPKIFException * > *  errorInfo = NULL  )  [virtual]

Interface: External

This function initializes a mediator object for use, including initialization of all associated colleagues. The errorInfo parameter can be used to collect exception objects thrown by colleagues during initialization. Colleagues that are not successfully initialized are ignored and the exception collected in the vector passed via errorInfo, if present.

Returns:
None
Parameters:
errorInfo  [in] Pointer to a vector to receive exceptions throw by colleagues during initialization

Reimplemented in CPKIFCryptoMediator2, CPKIFPathProcessingMediator2, CPKIFRevocationStatusMediator2, CPKIFCacheMediator2, CPKIFEmptyMediator, and CPKIFX509ExtensionMediator2.

Definition at line 146 of file IPKIFColleague.cpp.

Referenced by CPKIFCMSAttributeMediator2::GetInstance().

void IPKIFColleague::Terminate (  )  [virtual]

Interface: External

This function prepares a mediator object for destruction by notifying associated mediators and colleagues.

Returns:
None

Reimplemented in CPKIFCryptoMediator2, CPKIFPathProcessingMediator2, CPKIFRevocationStatusMediator2, CPKIFCacheMediator2, CPKIFX509ExtensionMediator2, and CPKIFCMSAttributeMediator2.

Definition at line 159 of file IPKIFColleague.cpp.

Referenced by CPKIFCacheMediator2::Terminate(), CPKIFRevocationStatusMediator2::Terminate(), CPKIFPathProcessingMediator2::Terminate(), CPKIFCryptoMediator2::Terminate(), and ~IPKIFColleague().

template<class X>
X * IPKIFMediator::GetMediator (  )  const [inline]

Interface: External

This function is the primary means by which an application obtains a pointer to a particular interface in order to exercise PKI and cryptographic functionality. In typically usage, an application creates a set of mediators and colleagues (possibly by invoking MakeDefaultMediator) the calls this function to perform a specific task. The following code shows an example:

Create a default mediator/colleague set IPKIFMediator* mediator = MakeDefaultMediator();

Get a pointer to the IPKIFPathBuild interface IPKIFPathBuild* iPB = g_mediator->GetMediator<IPKIFPathBuild>();

Exercise the IPKIFPathBuild interface

This function can also be used to access mediator objects directly when adding additional colleague objects, as shown in the following example.

Create a default mediator/colleague set IPKIFMediator* mediator = MakeDefaultMediator();

Create an instance of CPKIFLDAPRepository CPKIFLDAPRepository* ldap = new CPKIFLDAPRepository(); ldap->SetHost("ldap.somedomain.com"); ldap->Set_Port(389);

Get a pointer to the cache mediator present in the default set and add the LDAP object as a colleague

CPKIFCacheMediator2* pCache = mediator->GetMediator<CPKIFCacheMediator2>(); pCache->AddColleague(ldap);

Returns:
This function returns a pointer to an object that implements the interface specified as a template parameter or NULL if no implementation of the interface can be found.

Definition at line 336 of file IPKIFColleague.h.

Referenced by CertPathWantBackToResultsAndStores(), CertPathWantBackToResultsAndStoresForDpd(), CPKIFMessageImprint::HashAndSet(), and StickCrlsFromWantBackInCrlStore().

void IPKIFColleague::AddMediator ( IPKIFMediatorPtr m  ) 

Interface: External

This function is used to build collections of mediator objects at runtime. For example, an application may create a CPKIFCacheMediator2 that relies upon custom colleagues then add default mediators for path processing, revocation status determination and cryptographic support via this function.

Returns:
None
Parameters:
m  [in] Pointer to an IPKIFMediator object to add

Definition at line 124 of file IPKIFColleague.cpp.

References m_mediators.

void IPKIFColleague::RemoveMediator ( IPKIFMediator m  ) 

Interface: External

This function can be used to remove a mediator object added via a call to AddMediator.

Returns:
None
Parameters:
m  [in] This function is used to remove a mediator object from the collection of mediator objects

Definition at line 187 of file IPKIFColleague.cpp.

References m_mediators.

void IPKIFColleague::RemoveMediatorAssociations (  ) 

Interface: External

This function is used to notify associated mediators that a mediator object is being terminated, or otherwise should no longer be a part of a mediator collection.

Returns:
None

Definition at line 209 of file IPKIFColleague.cpp.

References m_mediators, and m_parents.

Referenced by CPKIFCacheMediator2::Terminate(), CPKIFRevocationStatusMediator2::Terminate(), CPKIFPathProcessingMediator2::Terminate(), and CPKIFCryptoMediator2::Terminate().

template<class X>
X * IPKIFMediator::GetMediator ( std::vector< const IPKIFColleague * > *  tree  )  const [inline]

Interface: External

This function is the primary means by which an application obtains a pointer to a particular interface in order to exercise PKI and cryptographic functionality. In typically usage, an application creates a set of mediators and colleagues (possibly by invoking MakeDefaultMediator) the calls this function to perform a specific task. The following code shows an example:

Create a default mediator/colleague set IPKIFMediator* mediator = MakeDefaultMediator();

Get a pointer to the IPKIFPathBuild interface IPKIFPathBuild* iPB = g_mediator->GetMediator<IPKIFPathBuild>();

Exercise the IPKIFPathBuild interface

This function can also be used to access mediator objects directly when adding additional colleague objects, as shown in the following example.

Create a default mediator/colleague set IPKIFMediator* mediator = MakeDefaultMediator();

Create an instance of CPKIFLDAPRepository CPKIFLDAPRepository* ldap = new CPKIFLDAPRepository(); ldap->SetHost("ldap.somedomain.com"); ldap->Set_Port(389);

Get a pointer to the cache mediator present in the default set and add the LDAP object as a colleague

CPKIFCacheMediator2* pCache = mediator->GetMediator<CPKIFCacheMediator2>(); pCache->AddColleague(ldap);

Returns:
This function returns a pointer to an object that implements the interface specified as a template parameter or NULL if no implementation of the interface can be found.
Parameters:
tree  [in] This parameter contains a list of objects already queried during a particular search for the interface specified as a template parameter (the version of this function that takes this parameter is only used internally)

Definition at line 282 of file IPKIFColleague.h.

References m_mediators.

void IPKIFColleague::GetMediators ( std::vector< IPKIFMediatorPtr > &  v  )  const

Interface: External

This function is used to retrieve the set of mediator objects that have been added using the AddMediator function. The list can be used to gain direcet access to a mediator for the purposes of adding colleagues, terminating the mediator, etc.

Returns:
None

Definition at line 241 of file IPKIFColleague.cpp.

References m_mediators.

template<class X>
X* IPKIFColleague::FindMediator ( const std::vector< IPKIFMediator * > &  v,
std::vector< const IPKIFColleague * > *  tree 
) const [inline]

Interface: Subsystem

This function is used by both IPKIFMediator and IPKIFColleague to search mediator vectors for a specific interface. This function exists because I couldn't get the template member function of IPKIFColleague to compile except when implemented inline. Oh well. Breaking this code out is probably a better solution anyway.

The purpose of this function is to return a pointer to a desired interface. The interface may be implemented or held by any mediator in a collection of mediators. We don't care where the interface comes from as long as we get it. The v param is the vector that is searched for the interface. The tree param contains pointers to mediators/colleagues already on the call stack so we don't loop.

Returns:
A pointer to a desired interface.

Definition at line 79 of file IPKIFColleague.h.

template<class X>
X* IPKIFColleague::FindMediator ( const std::vector< IPKIFMediatorPtr > &  v,
std::vector< const IPKIFColleague * > *  tree 
) const [inline]

Interface: Subsystem

This function is used by both IPKIFMediator and IPKIFColleague to search mediator vectors for a specific interface. This function exists because I couldn't get the template member function of IPKIFColleague to compile except when implemented inline. Oh well. Breaking this code out is probably a better solution anyway.

The purpose of this function is to return a pointer to a desired interface. The interface may be implemented or held by any mediator in a collection of mediators. We don't care where the interface comes from as long as we get it. The v param is the vector that is searched for the interface. The tree param contains pointers to mediators/colleagues already on the call stack so we don't loop.

Returns:
A pointer to a desired interface.

Definition at line 147 of file IPKIFColleague.h.

template<class X>
X* IPKIFColleague::GetMediatorFromParent (  )  const [inline]

Interface: Subsystem

This function should be called when initiating a search. we create a vector and push this instance into it then call the other GetMediatorFromParent function.

Returns:
An apropriate mediator

Definition at line 209 of file IPKIFColleague.h.

Referenced by _CreateComplexOCSPRequest(), _CreateSimpleOCSPRequest(), _GetCRLIssuersCert(), _HashIssuerName(), and _HashPublicKey().

template<class X>
X* IPKIFColleague::GetMediatorFromParent ( std::vector< const IPKIFColleague * > *  tree  )  const [inline]

Interface: Subsystem

This function is called when a search is underway. push this into the vector and call FindMediator.

Returns:
An apropriate mediator

Definition at line 225 of file IPKIFColleague.h.


Member Data Documentation

std::vector<IPKIFMediator*> IPKIFColleague::m_parents [protected]


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

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