CPKIFCredential Class Reference

#include <PKIFCredential.h>

Inheritance diagram for CPKIFCredential:

Inheritance graph
[legend]
Collaboration diagram for CPKIFCredential:

Collaboration graph
[legend]

List of all members.


Detailed Description

CPKIFCredential is the base class for the credential objects used by colleagues that implement the IPKIFCryptoKeyIDOperations and/or IPKIFCryptoKeyManagement interfaces. Implementations of those interfaces should provide a concrete implementation of the CPKIFCredential interface. Applications always handle credentials as CPKIFCredential objects, never as a derived object.

TSP-enforcing: Yes

Definition at line 27 of file PKIFCredential.h.


Public Member Functions

 CPKIFCredential ()
virtual ~CPKIFCredential ()
virtual const char * Name () const
virtual const char * ID () const
virtual void SetPassword (unsigned char *password, int len)=0
virtual CPKIFCertificatePtr GetCertificate () const =0
virtual CPKIFKeyMaterialPtr GetPublicKey () const

Protected Attributes

CPKIFStringPtr m_name
CPKIFStringPtr m_id

Constructor & Destructor Documentation

CPKIFCredential::CPKIFCredential ( void   ) 

Interface: External

This function is the default constructor for CPKIFCredential objects.

Returns:
None

Definition at line 23 of file CACCredential.cpp.

References LOG_STRING_DEBUG, and TOOLKIT_CRYPTO_MISC.

CPKIFCredential::~CPKIFCredential ( void   )  [virtual]

Interface: External

This function is the default destructor for CPKIFCredential objects.

Returns:
None

Definition at line 35 of file CACCredential.cpp.

References LOG_STRING_DEBUG, and TOOLKIT_CRYPTO_MISC.


Member Function Documentation

const char * CPKIFCredential::Name (  )  const [virtual]

Interface: External

This function retrieves the name associated with a credential. The pointer is only valid for the life of the associated credential object, i.e. the string is no longer valid after the credential object is destroyed.

The content and format of the name may vary depending on the colleague object that provides access to the credential. By default, PKIF provides a single colleague class for this purpose, CPKIFCAPI2. The name form included in credentials created by this class follow the friendly name rules implemented by the CertGetNameString function available in the Microsoft Crypto API. See MSDN documentation for details regarding the name forms. PKIF always queries for the CERT_NAME_FRIENDLY_DISPLAY_TYPE name form.

Return values:
pointer to a NULL-terminated string that contains the name of the credential
NULL if no name is available.

Definition at line 54 of file CACCredential.cpp.

References LOG_STRING_DEBUG, m_name, and TOOLKIT_CRYPTO_MISC.

const char * CPKIFCredential::ID (  )  const [virtual]

Interface: External

This function retrieves the key identifier associated with a credential. The key identifier value is returned as an ASCII hexadecimal string. The value may be encapsulated in a std::string object and passed to the SetDefaultKey function to specify a default credential. The pointer is only valid for the life of the associated credential object, i.e. the string is no longer valid after the credential object is destroyed.

Returns:
This function returns a pointer to a NULL-terminated string that contains the key identifier associated with the credential object or NULL if no ID is available

Definition at line 75 of file CACCredential.cpp.

References LOG_STRING_DEBUG, m_id, and TOOLKIT_CRYPTO_MISC.

Referenced by CPKIFCryptoMediator2::Sign(), and CPKIFCryptoMediator2::Verify().

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

This function may be used to specify a password used to access a credential. Not all cryptographic service providers provide support for programmatic password entry, thus use of this function is discouraged. CPKIFCredential does not provide an implementation of this function, which is a pure virtual function that must be implemented by derived classes.

Returns:
None

Implemented in CPKIFCAPICredential2, CPKIFCryptoPPCredential, and CPKIFNSSCredential.

virtual CPKIFCertificatePtr CPKIFCredential::GetCertificate (  )  const [pure virtual]

This function retrieves the X.509 certificate associated with the credential as a smart pointer to a CPKIFCertificate object. CPKIFCredential does not provide an implementation of this function, which is a pure virtual function that must be implemented by derived classes.

Returns:
Pointer to a certificate object or NULL if no certificate is associated with the credential

Implemented in CPKIFCAPICredential2, CPKIFCryptoPPCredential, and CPKIFNSSCredential.

Referenced by GetPublicKey(), and CPKIFCAPI2::Sign().

CPKIFKeyMaterialPtr CPKIFCredential::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 in CPKIFCryptoPPCredential.

Definition at line 97 of file CACCredential.cpp.

References GetCertificate(), LOG_STRING_DEBUG, and TOOLKIT_CRYPTO_MISC.

Referenced by CPKIFCryptoPPCredential::GetPublicKey().


Member Data Documentation

Definition at line 55 of file PKIFCredential.h.

Referenced by CPKIFNSSCredential::CPKIFNSSCredential(), and Name().

Definition at line 56 of file PKIFCredential.h.

Referenced by CPKIFNSSCredential::CPKIFNSSCredential(), and ID().


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

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