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

WinCAPICryptoProvider Class Reference

#include <WinCAPICryptoProvider.hpp>

Inheritance diagram for WinCAPICryptoProvider:

Inheritance graph
[legend]
Collaboration diagram for WinCAPICryptoProvider:

Collaboration graph
[legend]
List of all members.

Windows CAPI Specific methods

HCRYPTPROV getProviderDSS (void)
 Returns the Crypto Provider being used for DSS.

HCRYPTPROV getProviderRSA (void)
 Returns the Provider being used for RSA functions.

HCRYPTPROV getApacheKeyStore (void)
 Return the internal key store provider.

virtual bool algorithmSupported (XSECCryptoSymmetricKey::SymmetricKeyType alg)
 Determine whether a given algorithm is supported.

virtual XSECCryptoSymmetricKeykeySymmetric (XSECCryptoSymmetricKey::SymmetricKeyType alg)
 Return a Symmetric Key implementation object.

virtual unsigned int getRandom (unsigned char *buffer, unsigned int numOctets)
 Obtain some random octets.

BYTE * b642WinBN (const char *b64, unsigned int b64Len, unsigned int &retLen)
 Translate B64 I2OS integer to a WinCAPI int.

unsigned char * WinBN2b64 (BYTE *n, DWORD nLen, unsigned int &retLen)
 Translate a WinCAPI int to a B64 I2OS integer .


Public Member Functions

Constructors and Destructors
 WinCAPICryptoProvider (LPCSTR provDSSName=NULL, LPCSTR provRSAName=NULL)
 Create a Windows CAPI interface layer.

virtual ~WinCAPICryptoProvider ()
Hashing (Digest) Functions
virtual XSECCryptoHashhashSHA1 ()
 Return a SHA1 implementation.

virtual XSECCryptoHashhashHMACSHA1 ()
 Return a HMAC SHA1 implementation.

virtual XSECCryptoHashhashMD5 ()
 Return a MD5 implementation.

virtual XSECCryptoHashhashHMACMD5 ()
 Return a HMAC MD5 implementation.

Encoding functions
virtual XSECCryptoBase64base64 ()
 Return a Base64 encoder/decoder implementation.

Keys and Certificates
virtual XSECCryptoKeyDSAkeyDSA ()
 Return a DSA key implementation object.

virtual XSECCryptoKeyRSAkeyRSA ()
 Return an RSA key implementation object.

virtual XSECCryptoX509X509 ()
 Return an X509 implementation object.

Information Functions
virtual const XMLCh * getProviderName ()
 Returns a string that identifies the Crypto Provider.


Constructor & Destructor Documentation

WinCAPICryptoProvider::WinCAPICryptoProvider LPCSTR  provDSSName = NULL,
LPCSTR  provRSAName = NULL
 

Create a Windows CAPI interface layer.

Windows CSPs work under a provider model. The user should specify which CSP to use.

Parameters:
provDSSName Name of DSS provider - must be of type PROV_DSS. Will use the default Windows DSS provider if nothing passed in.
provRSAName RSA provider - must be of type PROV_RSA_FULL. Will use the default RSA_FULL provider if nothing passed in

virtual WinCAPICryptoProvider::~WinCAPICryptoProvider  )  [virtual]
 


Member Function Documentation

virtual bool WinCAPICryptoProvider::algorithmSupported XSECCryptoSymmetricKey::SymmetricKeyType  alg  )  [virtual]
 

Determine whether a given algorithm is supported.

A call that can be used to determine whether a given symmetric algorithm is supported

Implements XSECCryptoProvider.

BYTE* WinCAPICryptoProvider::b642WinBN const char *  b64,
unsigned int  b64Len,
unsigned int &  retLen
[static]
 

Translate B64 I2OS integer to a WinCAPI int.

Decodes a Base64 (ds:CryptoBinary) integer and reverses the order to allow loading into a Windows CAPI function. (CAPI uses Little Endian storage of integers).

Parameters:
b64 Base 64 string
b64Len Length of base64 string
retLen Parameter to hold length of return integer

virtual XSECCryptoBase64* WinCAPICryptoProvider::base64  )  [virtual]
 

Return a Base64 encoder/decoder implementation.

Call used by the library to obtain a Base64 encoder/decoder.

Note:
Windows providers do not implement Base64, so the internal implementation (XSCrypt) is used instead.
Returns:
Pointer to the new Base64 encoder.
See also:
XSCryptCryptoBase64

Implements XSECCryptoProvider.

HCRYPTPROV WinCAPICryptoProvider::getApacheKeyStore void   )  [inline]
 

Return the internal key store provider.

HCRYPTPROV WinCAPICryptoProvider::getProviderDSS void   )  [inline]
 

Returns the Crypto Provider being used for DSS.

virtual const XMLCh* WinCAPICryptoProvider::getProviderName  )  [virtual]
 

Returns a string that identifies the Crypto Provider.

Implements XSECCryptoProvider.

HCRYPTPROV WinCAPICryptoProvider::getProviderRSA void   )  [inline]
 

Returns the Provider being used for RSA functions.

virtual unsigned int WinCAPICryptoProvider::getRandom unsigned char *  buffer,
unsigned int  numOctets
[virtual]
 

Obtain some random octets.

For generation of IVs and the like, the library needs to be able to obtain "random" octets. The library uses this call to the crypto provider to obtain what it needs.

Parameters:
buffer The buffer to place the random data in
numOctets Number of bytes required
Returns:
Number of bytes obtained.

Implements XSECCryptoProvider.

virtual XSECCryptoHash* WinCAPICryptoProvider::hashHMACMD5  )  [virtual]
 

Return a HMAC MD5 implementation.

Call used by the library to obtain a HMAC MD5 object from the provider. The caller will need to set the key in the hash object with an XSECCryptoKeyHMAC using XSECCryptoHash::setKey()

Note:
The use of MD5 is explicitly marked as not recommended in the XML Digital Signature standard due to recent advances in cryptography indicating there may be weaknesses in the algorithm.
Returns:
A pointer to a Hash object that implements HMAC-MD5
See also:
WinCAPICryptoHash

Implements XSECCryptoProvider.

virtual XSECCryptoHash* WinCAPICryptoProvider::hashHMACSHA1  )  [virtual]
 

Return a HMAC SHA1 implementation.

Call used by the library to obtain a HMAC SHA1 object from the provider. The caller will need to set the key in the hash object with an XSECCryptoKeyHMAC using WinCAPICryptoHash::setKey()

Returns:
A pointer to a Hash object that implements HMAC-SHA1
See also:
WinCAPICryptoHash

Implements XSECCryptoProvider.

virtual XSECCryptoHash* WinCAPICryptoProvider::hashMD5  )  [virtual]
 

Return a MD5 implementation.

Call used by the library to obtain a MD5 object from the OpenSSL provider.

Returns:
A pointer to a Hash object that implements MD5
See also:
WinCAPICryptoHash

Implements XSECCryptoProvider.

virtual XSECCryptoHash* WinCAPICryptoProvider::hashSHA1  )  [virtual]
 

Return a SHA1 implementation.

Call used by the library to obtain a SHA1 object from the provider.

Returns:
A pointer to an OpenSSL Hash object that implements SHA1
See also:
WinCAPICryptoHash

Implements XSECCryptoProvider.

virtual XSECCryptoKeyDSA* WinCAPICryptoProvider::keyDSA  )  [virtual]
 

Return a DSA key implementation object.

Call used by the library to obtain a DSA key object.

Returns:
Pointer to the new DSA key
See also:
WinCAPICryptoKeyDSA

Implements XSECCryptoProvider.

virtual XSECCryptoKeyRSA* WinCAPICryptoProvider::keyRSA  )  [virtual]
 

Return an RSA key implementation object.

Call used by the library to obtain an OpenSSL RSA key object.

Returns:
Pointer to the new RSA key
See also:
WinCAPICryptoKeyRSA

Implements XSECCryptoProvider.

virtual XSECCryptoSymmetricKey* WinCAPICryptoProvider::keySymmetric XSECCryptoSymmetricKey::SymmetricKeyType  alg  )  [virtual]
 

Return a Symmetric Key implementation object.

Call used by the library to obtain a bulk encryption object.

Returns:
Pointer to the new SymmetricKey object
See also:
XSECCryptoSymmetricKey

Implements XSECCryptoProvider.

unsigned char* WinCAPICryptoProvider::WinBN2b64 BYTE *  n,
DWORD  nLen,
unsigned int &  retLen
[static]
 

Translate a WinCAPI int to a B64 I2OS integer .

Encodes a Windows integer in I2OSP base64 encoded format.

Parameters:
n Buffer holding the Windows Integer
nLen Length of data in buffer
retLen Parameter to hold length of return integer
Returns:
A pointer to a buffer holding the encoded data (transfers ownership)

virtual XSECCryptoX509* WinCAPICryptoProvider::X509  )  [virtual]
 

Return an X509 implementation object.

Call used by the library to obtain an object that can work with X509 certificates.

Returns:
Pointer to the new X509 object
See also:
WinCAPICryptoX509

Implements XSECCryptoProvider.


The documentation for this class was generated from the following file:
Generated on Sun Mar 14 20:22:17 2004 for XML-Security-C by doxygen 1.3.2