Main Page | Modules | Class Hierarchy | Compound List | File List | Compound 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 ()
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.


Constructor & Destructor Documentation

WinCAPICryptoKeyHMAC::WinCAPICryptoKeyHMAC  ) 
 

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

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


The documentation for this class was generated from the following file:
Generated on Sat Aug 9 18:36:53 2003 for XML-Security-C by doxygen 1.3.2