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

WinCAPICryptoKeyRSA Class Reference

#include <WinCAPICryptoKeyRSA.hpp>

Inheritance diagram for WinCAPICryptoKeyRSA:

Inheritance graph
[legend]
Collaboration diagram for WinCAPICryptoKeyRSA:

Collaboration graph
[legend]
List of all members.

Public Methods

 WinCAPICryptoKeyRSA (WinCAPICryptoProvider *owner)
 WinCAPICryptoKeyRSA (WinCAPICryptoProvider *owner, HCRYPTKEY k, bool havePrivate=false)
 Dedicated WinCAPI constructor.

virtual ~WinCAPICryptoKeyRSA ()
virtual XSECCryptoKey::KeyType getKeyType ()
 Return the type of this key.

virtual const XMLCh * getProviderName ()
 Returns a string that identifies the crypto owner of this library.

virtual XSECCryptoKeyclone ()
 Replicate key.

virtual void loadPublicModulusBase64BigNums (const char *b64, unsigned int len)
 Load the modulus.

virtual void loadPublicExponentBase64BigNums (const char *b64, unsigned int len)
 Load the exponent.

virtual bool verifySHA1PKCS1Base64Signature (const unsigned char *hashBuf, unsigned int hashLen, const char *base64Signature, unsigned int sigLen)
 Verify a SHA1 PKCS1 encoded signature.

virtual unsigned int signSHA1PKCS1Base64Signature (unsigned char *hashBuf, unsigned int hashLen, char *base64SignatureBuf, unsigned int base64SignatureBufLen)
 Create a signature.

 WinCAPICryptoKeyRSA (HCRYPTKEY k)
unsigned int getExponentBase64BigNums (char *b64, unsigned int len)
unsigned int getModulusBase64BigNums (char *b64, unsigned int len)

Constructor & Destructor Documentation

WinCAPICryptoKeyRSA::WinCAPICryptoKeyRSA WinCAPICryptoProvider   owner
 

WinCAPICryptoKeyRSA::WinCAPICryptoKeyRSA WinCAPICryptoProvider   owner,
HCRYPTKEY    k,
bool    havePrivate = false
 

Dedicated WinCAPI constructor.

Create a RSA key for use in XSEC from an existing HCRYPTKEY

Parameters:
owner  The owner provider object (needed to find CSP)
k  The key to use
havePrivate  The CSP holds the private key as well as public
Note:
k is owned by the library. When the wrapper WinCAPICryptoKeyRSA is deleted, k will be destroyed using CryptDestroyKey()

virtual WinCAPICryptoKeyRSA::~WinCAPICryptoKeyRSA   [virtual]
 

WinCAPICryptoKeyRSA::WinCAPICryptoKeyRSA HCRYPTKEY    k
 


Member Function Documentation

virtual XSECCryptoKey* WinCAPICryptoKeyRSA::clone   [virtual]
 

Replicate key.

Implements XSECCryptoKeyRSA.

unsigned int WinCAPICryptoKeyRSA::getExponentBase64BigNums char *    b64,
unsigned int    len
 

virtual XSECCryptoKey::KeyType WinCAPICryptoKeyRSA::getKeyType   [virtual]
 

Return the type of this key.

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

Reimplemented from XSECCryptoKeyRSA.

unsigned int WinCAPICryptoKeyRSA::getModulusBase64BigNums char *    b64,
unsigned int    len
 

virtual const XMLCh* WinCAPICryptoKeyRSA::getProviderName   [inline, virtual]
 

Returns a string that identifies the crypto owner of this library.

Implements XSECCryptoKey.

virtual void WinCAPICryptoKeyRSA::loadPublicExponentBase64BigNums const char *    b64,
unsigned int    len
[virtual]
 

Load the exponent.

Load the exponent from a Base64 encoded string

param b64 A buffer containing the encoded string param len The length of the data in the buffer

Implements XSECCryptoKeyRSA.

virtual void WinCAPICryptoKeyRSA::loadPublicModulusBase64BigNums const char *    b64,
unsigned int    len
[virtual]
 

Load the modulus.

Load the modulus from a Base64 encoded string

param b64 A buffer containing the encoded string param len The length of the data in the buffer

Implements XSECCryptoKeyRSA.

virtual unsigned int WinCAPICryptoKeyRSA::signSHA1PKCS1Base64Signature unsigned char *    hashBuf,
unsigned int    hashLen,
char *    base64SignatureBuf,
unsigned int    base64SignatureBufLen
[virtual]
 

Create a signature.

The library will call this function to create a signature from a pre-calculated digest. The output signature is required to be Base64 encoded such that it can be placed directly into the XML document

This call needs to do a PKCS1 encode for a SHA-1 signature.

Parameters:
hashBuf  Buffer containing the pre-calculated (binary) digest
hashLen  Number of bytes of hash in the hashBuf
base64SignatureBuf  Buffer to place the base64 encoded result in.
base64SignatureBufLen  Implementations need to ensure they do not write more bytes than this into the buffer

Implements XSECCryptoKeyRSA.

virtual bool WinCAPICryptoKeyRSA::verifySHA1PKCS1Base64Signature const unsigned char *    hashBuf,
unsigned int    hashLen,
const char *    base64Signature,
unsigned int    sigLen
[virtual]
 

Verify a SHA1 PKCS1 encoded signature.

The library will call this function to validate an RSA signature The standard by default uses SHA1 in a PKCS1 encoding.

Parameters:
hashBuf  Buffer containing the pre-calculated (binary) digest
hashLen  Length of the data in the digest buffer
base64Signature  Buffer containing the Base64 encoded signature
sigLen  Length of the data in the signature buffer
Returns:
true if the signature was valid, false otherwise

Implements XSECCryptoKeyRSA.


The documentation for this class was generated from the following file:
Generated on Wed May 7 21:44:12 2003 for XML-Security-C by doxygen1.2.18