CPKIFBCryptGuard Class Reference

#include <PKIFBCryptGuard.h>

Collaboration diagram for CPKIFBCryptGuard:

Collaboration graph
[legend]

List of all members.


Detailed Description

A singleton-like class that attempts to see if CNG is available at runtime. This is part of PKIF because proximity to the CNG colleague makes sense, but needs to be CAC_API so that applications can test for CNG before attempting to instantiate the colleague and encountering the delay loader error. To use it:

CPKIFBCryptGuard cngGuard; if(cngGuard.IsCNGAvailable()) { ... do CNG things ... } else { ... do CAPI things ... }

Definition at line 33 of file PKIFBCryptGuard.h.


Public Member Functions

 CPKIFBCryptGuard ()
 ~CPKIFBCryptGuard ()
bool IsCNGAvailable ()
const char * GetLoaderError ()

Static Public Member Functions

static void Shutdown ()

Constructor & Destructor Documentation

CPKIFBCryptGuard::CPKIFBCryptGuard (  ) 

Interface: External

Default constructor. all actual work is handled by the impl, which is a singleton

Returns:
None

Definition at line 98 of file PKIFBCryptGuard.cpp.

CPKIFBCryptGuard::~CPKIFBCryptGuard (  ) 

Interface: External

Default destructor.

Returns:
None

Definition at line 111 of file PKIFBCryptGuard.cpp.


Member Function Documentation

bool CPKIFBCryptGuard::IsCNGAvailable (  ) 

Interface: External

Test whether CNG can be loaded and used.

Returns:
true if CNG can be used, false otherwise

Definition at line 140 of file PKIFBCryptGuard.cpp.

References CPKIFBCryptGuardImpl::IsCNGAvailable().

Referenced by LoadCryptoComponents(), MakeDefaultKeyIDColleague(), MakeDefaultMediator(), MakeDefaultRawColleague(), and SaveCryptoComponents().

const char * CPKIFBCryptGuard::GetLoaderError (  ) 

Interface: External

Return any error message that's around from the last attempt to load CNG

Returns:
Error message that's around from the last attempt to load CNG

Definition at line 155 of file PKIFBCryptGuard.cpp.

References CPKIFBCryptGuardImpl::GetLastError().

void CPKIFBCryptGuard::Shutdown (  )  [static]

Interface: External

Called to clean up the singleton impl. This should really never be called by a user of the library under normal circumstances; BCryptGuardCleanerInstance will take care of it when PKIF is unloaded

Returns:
None

Definition at line 125 of file PKIFBCryptGuard.cpp.

Referenced by BCryptGuardCleaner::~BCryptGuardCleaner().


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

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