CPKIFCAPIUserRepository2 Class Reference

#include <PKIFCAPIUserRepository2.h>

Inheritance diagram for CPKIFCAPIUserRepository2:

Inheritance graph
[legend]
Collaboration diagram for CPKIFCAPIUserRepository2:

Collaboration graph
[legend]

List of all members.


Detailed Description

The CPKIFCAPIUserRepository2 class can be used to retrieve certificates from a Microsoft CAPI certificate store. It implements one PKI-related interface: IPKIFCertSearch. Each instance of this class is associated with a specific Microsoft CAPI certificate store. The constructor takes two parameters that are used to specify which certificate store is associated with an instance of this class. The default constructor parameters are:
     CERT_SYSTEM_STORE_CURRENT_USER 
     "AddressBook". 
These parameters are passed to the Windows CertOpenStore function upon initialization. The "AddressBook" certificate store is created when Microsoft Outlook is installed. Consult Microsoft MSDN documentation for details on various options that may be used to target an alternative certificate store. Typically, this class is not used directly by applications and is primarily intended for as a colleague associated with a cache mediator used by the path builder.

TSP-enforcing: No

Definition at line 38 of file PKIFCAPIUserRepository2.h.


Public Member Functions

 CPKIFCAPIUserRepository2 (int sysStoRegLoc=CERT_SYSTEM_STORE_CURRENT_USER, const char *store=g_defCACCAPIEEStore)
virtual ~CPKIFCAPIUserRepository2 (void)
void Initialize (void)
void FindCertificates (IPKIFSearchCriteria *searchCriteria, CPKIFCertificateList &certList, PKIInfoSource source=ALL)

Constructor & Destructor Documentation

CPKIFCAPIUserRepository2::CPKIFCAPIUserRepository2 ( int  sysStoRegLoc = CERT_SYSTEM_STORE_CURRENT_USER,
const char *  store = g_defCACCAPIEEStore 
)

Interface: External

This function creates and initializes CPKIFCAPIUserRepository2 objects. The parameters determine which certificate store is associated with an instance of CPKIFCAPIUserRepository2. The default certificate store is the "AddressBook" store associated with the current Windows user. For Windows services using PKIF, the sysStoRegLoc parameter should be set to CERT_SYSTEM_STORE_LOCA_MACHINE and the store parameter can be left to the default value. Consult Microsoft MSDN documentation for details on various options that may be used to target an alternative certificate store.

This function does not attempt to open the certificate store identified by the parameters. An attempt to open the store will be made when the Initialize function is called, which occurs when an instance of CPKIFCAPIUserRepository2 is passed to the AddColleague function of a mediator class (presumably the CPKIFCacheMediator2 class).

Returns:
None
Parameters:
sysStoRegLoc  [in] An integer indicating which certificate store is associated with an instance of CPKIFCAPITrustRootCRLRepository2.
store  [in] An NULL terminated string indicating which certificate store is associated with an instance of CPKIFCAPITrustRootCRLRepository2.

Definition at line 60 of file PKIFCAPIUserRepository2.cpp.

References LOG_STRING_DEBUG, and TOOLKIT_SR_CAPIUSERREPOSITORY.

CPKIFCAPIUserRepository2::~CPKIFCAPIUserRepository2 ( void   )  [virtual]

Interface: External

This function destroys CPKIFCAPIUserRepository2 objects

Returns:
None

Definition at line 91 of file PKIFCAPIUserRepository2.cpp.

References LOG_STRING_DEBUG, and TOOLKIT_SR_CAPIUSERREPOSITORY.


Member Function Documentation

void CPKIFCAPIUserRepository2::Initialize ( void   )  [virtual]

Interface: External

This function initializes an instance for use in a collection of IPKIFColleague objects held by a mediator. This function may generate an exception containing the following error code CACHE_CERT_STORE_OPEN_FAILED

Returns:
None
Exceptions:
CPKIFCacheException(CACHE_CERT_STORE_OPEN_FAILED) 

Reimplemented from IPKIFColleague.

Definition at line 116 of file PKIFCAPIUserRepository2.cpp.

References CACHE_CERT_STORE_OPEN_FAILED, COMMON_ALREADY_INITIALIZED, LOG_STRING_DEBUG, LOG_STRING_WARN, RAISE_CACHE_EXCEPTION, TOOLKIT_SR_CAPIREPOSITORY, and TOOLKIT_SR_CAPIUSERREPOSITORY.

void CPKIFCAPIUserRepository2::FindCertificates ( IPKIFSearchCriteria searchCriteria,
CPKIFCertificateList certList,
PKIInfoSource  source = ALL 
) [virtual]

Interface: External

This function appends pointers to certificates that match the criteria identified by searchCriteria to certList. The function simply returns without searching when source is equal to REMOTE. This function will search the certificate store identified by the template parameters. This function supports the following search criteria (indicated by the value returned from the GetType function of the object passed as searchCriteria): ALLCERTS, ISSUERNAME, SUBJECTNAME, ISSUERSERIAL and KEYID. This function may generate an exception containing the following error code CACHE_PARSE_ERROR.

Returns:
None
Exceptions:
CPKIFCacheException(CACHE_PARSE_ERROR) 
Parameters:
searchCriteria  [in] Pointer to a searchCriteria interface
certList  [out] List of certificates that match the specified search criteria
source  [in] PKIInfoSource value indicating the locations to search

Implements IPKIFCertSearch.

Definition at line 150 of file PKIFCAPIUserRepository2.cpp.

References ALLCERTS, atob(), CACHE_PARSE_ERROR, COMMON_INVALID_INPUT, CPKIFIssuerNameAndSerialNumberBasedSearch::GetIssuerName(), CPKIFKeyIDBasedSearch::GetKeyID(), IPKIFSearchCriteria::GetSearchType(), CPKIFIssuerNameAndSerialNumberBasedSearch::GetSerialNumber(), CPKIFNameBasedSearch::GetStringName(), ISSUERNAME, ISSUERSERIAL, KEYID, LOG_STRING_DEBUG, LOG_STRING_ERROR, PKIFDelete(), PKIFENUMS::REMOTE, ReverseBytes(), GottaMatch< T >::SetRHS(), StrToName(), SUBJECTNAME, and TOOLKIT_SR_CAPIUSERREPOSITORY.


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

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