#include <PKIFCredential.h>
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 |
CPKIFCredential::CPKIFCredential | ( | void | ) |
Interface: External
This function is the default constructor for CPKIFCredential objects.
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.
Definition at line 35 of file CACCredential.cpp.
References LOG_STRING_DEBUG, and TOOLKIT_CRYPTO_MISC.
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.
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.
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.
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.
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.
Reimplemented in CPKIFCryptoPPCredential.
Definition at line 97 of file CACCredential.cpp.
References GetCertificate(), LOG_STRING_DEBUG, and TOOLKIT_CRYPTO_MISC.
Referenced by CPKIFCryptoPPCredential::GetPublicKey().
CPKIFStringPtr CPKIFCredential::m_name [protected] |
Definition at line 55 of file PKIFCredential.h.
Referenced by CPKIFNSSCredential::CPKIFNSSCredential(), and Name().
CPKIFStringPtr CPKIFCredential::m_id [protected] |
Definition at line 56 of file PKIFCredential.h.
Referenced by CPKIFNSSCredential::CPKIFNSSCredential(), and ID().