CPKIFBCryptPublicKey Class Reference

#include <PKIFBCryptPublicKey.h>

Collaboration diagram for CPKIFBCryptPublicKey:

Collaboration graph
[legend]

List of all members.


Detailed Description

This is a utility class that handles getting a public key from CPKIFKeyMaterial into CNG for use in verification and encryption. Applications should not use this directly.

Definition at line 25 of file PKIFBCryptPublicKey.h.


Public Member Functions

 CPKIFBCryptPublicKey ()
 ~CPKIFBCryptPublicKey ()
BCRYPT_KEY_HANDLE Initialize (const CPKIFKeyMaterial &km)
BCRYPT_KEY_HANDLE Initialize (const CPKIFBufferPtr &km)
BCRYPT_KEY_HANDLE GetCNGHandle () const
CPKIFAlgorithmIdentifierPtr GetAlgId () const

Protected Member Functions

 CPKIFBCryptPublicKey (const CPKIFBCryptPublicKey &)
 no copy c'tor
void clear ()
 CPKIFSubjectPublicKeyInfoPtr (m_spki)

Protected Attributes

BCRYPT_KEY_HANDLE m_hKey
BCRYPT_ALG_HANDLE m_hAlg

Constructor & Destructor Documentation

CPKIFBCryptPublicKey::CPKIFBCryptPublicKey (  ) 

Interface: External

Default constructor.

Returns:
None

Definition at line 70 of file PKIFBCryptPublicKey.cpp.

CPKIFBCryptPublicKey::~CPKIFBCryptPublicKey (  ) 

Interface: External

Default destructor.

Returns:
None

Definition at line 81 of file PKIFBCryptPublicKey.cpp.

References clear().

CPKIFBCryptPublicKey::CPKIFBCryptPublicKey ( const CPKIFBCryptPublicKey  )  [protected]

no copy c'tor


Member Function Documentation

BCRYPT_KEY_HANDLE CPKIFBCryptPublicKey::Initialize ( const CPKIFKeyMaterial km  ) 

Interface: External

Get a key material object into a bcrypt key handle, jumping through whatever hoops may be required for that particular kind of key.

this is for internal use only... was only factored out because I was repeating similar code too much.

Returns:
None

Definition at line 142 of file PKIFBCryptPublicKey.cpp.

References clear(), COMMON_INVALID_INPUT, CPKIFSubjectPublicKeyInfoPtr(), GetCAPI1ProvType(), CPKIFKeyMaterial::GetCertificate(), CPKIFKeyMaterial::GetCertificateLength(), GetCNGHandle(), CPKIFKeyMaterial::GetSubjectPublicKeyInfo(), CPKIFKeyMaterial::GetWorkingParameters(), LOG_STRING_DEBUG, m_hAlg, m_hKey, NT_SUCCESS, PKIFCAPING_KEY_IMPORT_FAILED, RAISE_CRYPTO_EXCEPTION, PKIFScopedArray< T >::reset(), TOOLKIT_CRYPTO, and TOOLKIT_CRYPTO_CAPIRAW.

Referenced by _CNGVerify(), and Initialize().

BCRYPT_KEY_HANDLE CPKIFBCryptPublicKey::Initialize ( const CPKIFBufferPtr &  km  ) 

Interface: External

Get a key material object into a bcrypt key handle, jumping through whatever hoops may be required for that particular kind of key.

this is for internal use only... was only factored out because I was repeating similar code too much.

Returns:
None

Definition at line 97 of file PKIFBCryptPublicKey.cpp.

References clear(), CPKIFSubjectPublicKeyInfoPtr(), Initialize(), LOG_STRING_DEBUG, PKIFCAPING_KEY_IMPORT_FAILED, RAISE_CRYPTO_EXCEPTION, TOOLKIT_CRYPTO, and TOOLKIT_CRYPTO_CAPIRAW.

BCRYPT_KEY_HANDLE CPKIFBCryptPublicKey::GetCNGHandle (  )  const

Interface: External

This function returns hash handle

Returns:
BCRYPT_KEY_HANDLE

Definition at line 350 of file PKIFBCryptPublicKey.cpp.

References m_hKey.

Referenced by Initialize().

CPKIFAlgorithmIdentifierPtr CPKIFBCryptPublicKey::GetAlgId (  )  const

Interface: External

This function returns algorithm identifier

Returns:
Smart pointer to CPKIFAlgorithmIdentifier object

Definition at line 337 of file PKIFBCryptPublicKey.cpp.

void CPKIFBCryptPublicKey::clear (  )  [protected]

Interface: External

This function frees class members

Returns:
None

Definition at line 361 of file PKIFBCryptPublicKey.cpp.

References CPKIFSubjectPublicKeyInfoPtr(), m_hAlg, and m_hKey.

Referenced by Initialize(), and ~CPKIFBCryptPublicKey().

CPKIFBCryptPublicKey::CPKIFSubjectPublicKeyInfoPtr ( m_spki   )  [protected]

Referenced by clear(), and Initialize().


Member Data Documentation

BCRYPT_KEY_HANDLE CPKIFBCryptPublicKey::m_hKey [protected]

Definition at line 40 of file PKIFBCryptPublicKey.h.

Referenced by clear(), GetCNGHandle(), and Initialize().

BCRYPT_ALG_HANDLE CPKIFBCryptPublicKey::m_hAlg [protected]

Definition at line 41 of file PKIFBCryptPublicKey.h.

Referenced by clear(), and Initialize().


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