Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

WinCAPICryptoKeyHMAC Class Reference
[Windows Crypto API Interface]

#include <WinCAPICryptoKeyHMAC.hpp>

Inheritance diagram for WinCAPICryptoKeyHMAC:

Inheritance graph
[legend]
Collaboration diagram for WinCAPICryptoKeyHMAC:

Collaboration graph
[legend]
List of all members.

Detailed Description

Windows Crypto API implementation for HMAC keys.

Used to provide HMAC keys to WinCAPI CryptoHashHMAC

Provides two types of key.

A Windows Key (via setWinKey) is a direct key that can be used by the Windows HMAC implementation.

A byte key (via setKey) is a string of bytes that will be used as a key. This requires an internal implementation of an HMAC using the Windows Digest functions, as the Windows API does not allow direct loading of these keys.


Public Member Functions

Constructors and Destructors
 WinCAPICryptoKeyHMAC (HCRYPTPROV prov)
 Constructor.
virtual ~WinCAPICryptoKeyHMAC ()
Key Interface methods
virtual XSECCryptoKey::KeyType getKeyType ()
 Return the type of this key.
virtual XSECCryptoKeyclone ()
 Replicate key.
virtual const XMLCh * getProviderName ()
 Return the WinCAPI string identifier.
Optional Interface methods
virtual void setKey (unsigned char *inBuf, unsigned int inLength)
 Set the key.
virtual unsigned int getKey (safeBuffer &outBuf)
 Get the key value.
Windows specific keys
void setWinKey (HCRYPTKEY k)
 Set a Windows key.
HCRYPTKEY getWinKey (void)
 Get a windows key.
HCRYPTPROV getWinKeyProv (void)
 Get a windows key provider.


Constructor & Destructor Documentation

WinCAPICryptoKeyHMAC::WinCAPICryptoKeyHMAC HCRYPTPROV  prov  ) 
 

Constructor.

Parameters:
prov The handle to the provider context that was used to create any Windows keys (later set via setKey). If this is not to be used for a windows key (i.e. will be used for a "normal" buffer of bytes as a key, then this value can be set to 0

virtual WinCAPICryptoKeyHMAC::~WinCAPICryptoKeyHMAC  )  [inline, virtual]
 


Member Function Documentation

virtual XSECCryptoKey* WinCAPICryptoKeyHMAC::clone  )  [virtual]
 

Replicate key.

Implements XSECCryptoKeyHMAC.

virtual unsigned int WinCAPICryptoKeyHMAC::getKey safeBuffer outBuf  )  [virtual]
 

Get the key value.

Copy the key into the safeBuffer and return the number of bytes copied.

Parameters:
outBuf Buffer to copy key into
Returns:
number of bytes copied in

Implements XSECCryptoKeyHMAC.

virtual XSECCryptoKey::KeyType WinCAPICryptoKeyHMAC::getKeyType  )  [inline, virtual]
 

Return the type of this key.

For DSA keys, this allows people to determine whether this is a public key, private key or a key pair

Reimplemented from XSECCryptoKeyHMAC.

virtual const XMLCh* WinCAPICryptoKeyHMAC::getProviderName  )  [inline, virtual]
 

Return the WinCAPI string identifier.

Implements XSECCryptoKey.

HCRYPTKEY WinCAPICryptoKeyHMAC::getWinKey void   ) 
 

Get a windows key.

Used by WinCAPICryptoHashHMAC to retrieve the key in order to load it into the HMAC function.

Returns:
The key to use or 0 if this object does not hold one

HCRYPTPROV WinCAPICryptoKeyHMAC::getWinKeyProv void   ) 
 

Get a windows key provider.

Used by WinCAPICryptoHashHMAC to retrieve the provider handle associated with an HMAC key in order to load it into the HMAC function.

Returns:
The key to use or 0 if this object does not hold one

virtual void WinCAPICryptoKeyHMAC::setKey unsigned char *  inBuf,
unsigned int  inLength
[virtual]
 

Set the key.

Set the key from the buffer

Parameters:
inBuf Buffer containing the direct bitwise representation of the key
inLength Number of bytes of key in the buffer
Note:
isSensitive() should have been called on the inbound buffer to ensure the contents is overwritten when the safeBuffer is deleted

Implements XSECCryptoKeyHMAC.

void WinCAPICryptoKeyHMAC::setWinKey HCRYPTKEY  k  ) 
 

Set a Windows key.

Set a Windows Crypto key that has been either derived via the various Crypt functions or has been loaded from an encrypted BLOB

Parameters:
k Windows CAPI key to load Note that the library now owns this key (and will destroy it).


The documentation for this class was generated from the following file:
Generated on Sun Jul 3 17:43:39 2005 for XML-Security-C by  doxygen 1.4.2