CPKIFCryptoPPCredential Class Reference

#include <PKIFCryptoPPCredential.h>

Inheritance diagram for CPKIFCryptoPPCredential:

Inheritance graph
[legend]
Collaboration diagram for CPKIFCryptoPPCredential:

Collaboration graph
[legend]

List of all members.


Detailed Description

The CPKIFCryptoPPCredential class provides a crypto++ implementation of the CPKIFCredential interface. This class provides access to stored key material for purposes of digital signature generation and data decryption using asymmetric key material. This class is not used by applications and may only be instantiated internally by PKIF classes. The constructor is declared private. Only compatible instantiations of CPKIFCryptoPP can create CPKIFCryptoPPCredential objects.

TSP-enforcing: No

Definition at line 33 of file PKIFCryptoPPCredential.h.


Public Member Functions

 CPKIFCryptoPPCredential ()
virtual ~CPKIFCryptoPPCredential ()
virtual void SetPassword (unsigned char *password, int len)
CPKIFCertificatePtr GetCertificate () const
CPKIFKeyMaterialPtr GetPublicKey () const
void SetCertificate (CPKIFCertificatePtr &)
void SetPrivateKey (CPKIFBufferPtr &)
void SetAlgorithm (CPKIFAlgorithm *)
CPKIFAlgorithmGetAlgorithm ()

Friends

class CPKIFCryptoPP

Constructor & Destructor Documentation

CPKIFCryptoPPCredential::CPKIFCryptoPPCredential (  ) 

Interface: Subsystem

This function creates CPKIFCryptoPPCredential objects.

Returns:
None

Definition at line 45 of file PKIFCryptoPPCredential.cpp.

References LOG_STRING_DEBUG, and TOOLKIT_CRYPTO_CRYPTOPPCRED.

CPKIFCryptoPPCredential::~CPKIFCryptoPPCredential ( void   )  [virtual]

Interface: Subsystem

This function destroys CPKIFCryptoPPCredential objects. This function overwrites the memory associated with with private keys via PKIFZero.

Returns:
None

Definition at line 59 of file PKIFCryptoPPCredential.cpp.

References LOG_STRING_DEBUG, PKIFZero(), and TOOLKIT_CRYPTO_CRYPTOPPCRED.


Member Function Documentation

void CPKIFCryptoPPCredential::SetPassword ( unsigned char *  password,
int  len 
) [virtual]

Interface: Subsystem

This function is used to specify a password that can be used to access the associated credential.

Credential-level passwords are not implemented for NSS. (They don't make sense for NSS)

Returns:
None
Exceptions:
CPKIFCryptoException(COMMON_NOT_IMPLEMENTED) 
Parameters:
password  [in] Pointer to a buffer containing a password
len  [in] Integer indicating the length of the password stored in the buffer passed via the password parameter

Implements CPKIFCredential.

Definition at line 88 of file PKIFCryptoPPCredential.cpp.

References COMMON_NOT_IMPLEMENTED, LOG_STRING_DEBUG, RAISE_CRYPTO_EXCEPTION, and TOOLKIT_CRYPTO_CRYPTOPPCRED.

CPKIFCertificatePtr CPKIFCryptoPPCredential::GetCertificate (  )  const [virtual]

Interface: Subsystem

This function returns a smart pointer to a CPKIFCertificate object containing the public key certificate that corresponds with the key material associated with the credential object. If the credential object is empty or no public key certificate is available, NULL is returned.

Returns:
smart pointer to a CPKIFCertificate object containing the public key certificate that corresponds with the key material associated with the credential object

Implements CPKIFCredential.

Definition at line 110 of file PKIFCryptoPPCredential.cpp.

References LOG_STRING_DEBUG, and TOOLKIT_CRYPTO_CRYPTOPPCRED.

CPKIFKeyMaterialPtr CPKIFCryptoPPCredential::GetPublicKey (  )  const [virtual]

Interface: External

This function returns a smart pointer to a CPKIFKeyMaterial object containing the associated public key.

The base class implementation relies on the GetCertificate() function and simply extracts the public key from the certificate; subclasses are not obligated to maintain this behavior.

Returns:
a smart pointer to a CPKIFKeyMaterial object containing the associated public key. An invalid pointer will be returned if there is no associated public key.

Reimplemented from CPKIFCredential.

Definition at line 116 of file PKIFCryptoPPCredential.cpp.

References CPKIFAlgorithm::AsymkeyAlg(), PKIFCRYPTO::DSS, PKIFCRYPTO::ECC, CPKIFCredential::GetPublicKey(), PKIF_CRYPTOPP_RAW_IMPORT_FAILED, RAISE_CRYPTO_EXCEPTION, PKIFCRYPTO::RSA, and TOOLKIT_CRYPTO_CRYPTOPPCRED.

void CPKIFCryptoPPCredential::SetCertificate ( CPKIFCertificatePtr &  cert  ) 

Interface: Subsystem

This function associates a certificate with the credential

Returns:
None

Definition at line 221 of file PKIFCryptoPPCredential.cpp.

References LOG_STRING_DEBUG, and TOOLKIT_CRYPTO_CRYPTOPPCRED.

void CPKIFCryptoPPCredential::SetPrivateKey ( CPKIFBufferPtr &  key  ) 

Interface: Subsystem

This function sets the credential's private key.

Returns:
None
Parameters:
key  [in] buffer containing a DER-encoded PKCS#8 private key structure. Crypto++ expects this structure to be decrypted already.

Definition at line 233 of file PKIFCryptoPPCredential.cpp.

Referenced by CPKIFCryptoPP::SecretAgree().

void CPKIFCryptoPPCredential::SetAlgorithm ( CPKIFAlgorithm alg  ) 

Interface: Subsystem

Store information about the key's algorithm

Returns:
None
Parameters:
alg  [in] pointer to a CPKIFAlgorithm instance describing the asymmetric key owned by this credential

Definition at line 248 of file PKIFCryptoPPCredential.cpp.

Referenced by CPKIFCryptoPP::SecretAgree().

CPKIFAlgorithm * CPKIFCryptoPPCredential::GetAlgorithm (  ) 

Interface: Subsystem

Retrieve information about the key's algorithm

Returns:
pointer to a CPKIFAlgorithm instance describing the asymmetric key

Definition at line 262 of file PKIFCryptoPPCredential.cpp.

Referenced by CPKIFCryptoPP::Sign().


Friends And Related Function Documentation

friend class CPKIFCryptoPP [friend]

Definition at line 35 of file PKIFCryptoPPCredential.h.


The documentation for this class was generated from the following files:

Generated on Mon Nov 15 11:20:11 2010 for PublicKeyInfrastructureFramework(PKIF) by  doxygen 1.5.6