#include <PKIFCryptoPPKeyMaterial.h>
This CPKIFKeyMaterial subclass stores public keys as a raw, encoded subjectPublicKeyInfo. That expedites signature processing in crypto++.
TSP-enforcing: No
Definition at line 29 of file PKIFCryptoPPKeyMaterial.h.
Public Member Functions | |
CPKIFCryptoPPKeyMaterial (void) | |
CPKIFCryptoPPKeyMaterial (const CPKIFCertificate &cert) | |
CPKIFCryptoPPKeyMaterial (CPKIFSubjectPublicKeyInfoPtr &spki) | |
CPKIFCryptoPPKeyMaterial (const CPKIFKeyMaterial &km) | |
~CPKIFCryptoPPKeyMaterial (void) | |
CPKIFBufferPtr | GetRawSPKI (void) const |
const CPKIFAlgorithm * | GetKeyAlg (void) const |
void | SetRawSPKI (const CPKIFBufferPtr &) |
void | SetKeyAlg (const CPKIFAlgorithm *) |
bool | HasParams () const |
Protected Member Functions | |
void | InitWithKeyMaterial (const CPKIFKeyMaterial &km) |
void | InitWithSPKI (CPKIFSubjectPublicKeyInfoPtr &spki) |
void | InitWithCert (const CPKIFCertificate &cert) |
Protected Attributes | |
CPKIFBufferPtr | m_rawSPKI |
const CPKIFAlgorithm * | m_alg |
bool | m_hasParams |
CPKIFCryptoPPKeyMaterial::CPKIFCryptoPPKeyMaterial | ( | void | ) |
Interface: Module
Construct and initialize an empty CPKIFCryptoPPKeyMaterial object
Definition at line 38 of file PKIFCryptoPPKeyMaterial.cpp.
CPKIFCryptoPPKeyMaterial::CPKIFCryptoPPKeyMaterial | ( | const CPKIFCertificate & | cert | ) |
Interface: Module
Construct and initialize a CPKIFCryptoPPKeyMaterial given a certificate
Definition at line 61 of file PKIFCryptoPPKeyMaterial.cpp.
References InitWithCert().
CPKIFCryptoPPKeyMaterial::CPKIFCryptoPPKeyMaterial | ( | CPKIFSubjectPublicKeyInfoPtr & | spki | ) |
Interface: Module
Construct and initialize a CPKIFCryptoPPKeyMaterial given a subjectPublicKeyInfo
Definition at line 74 of file PKIFCryptoPPKeyMaterial.cpp.
References InitWithSPKI().
CPKIFCryptoPPKeyMaterial::CPKIFCryptoPPKeyMaterial | ( | const CPKIFKeyMaterial & | km | ) |
Interface: Module
Construct and initialize a CPKIFCryptoPPKeyMaterial given some other kind of CPKIFKeyMaterial
Definition at line 87 of file PKIFCryptoPPKeyMaterial.cpp.
References InitWithKeyMaterial().
CPKIFCryptoPPKeyMaterial::~CPKIFCryptoPPKeyMaterial | ( | void | ) |
Interface: Module
Since the only members are a smart pointer and a pointer we don't own, the destructor is a nop.
Definition at line 50 of file PKIFCryptoPPKeyMaterial.cpp.
CPKIFBufferPtr CPKIFCryptoPPKeyMaterial::GetRawSPKI | ( | void | ) | const |
Interface: Module
Helper function that returns der-encoded subjectPublicKeyInfo
Definition at line 100 of file PKIFCryptoPPKeyMaterial.cpp.
References m_rawSPKI.
const CPKIFAlgorithm * CPKIFCryptoPPKeyMaterial::GetKeyAlg | ( | void | ) | const |
Interface: Module
Helper function that returns a CPKIFAlgorithm object describing the associated key's algorithm
Definition at line 112 of file PKIFCryptoPPKeyMaterial.cpp.
References m_alg.
void CPKIFCryptoPPKeyMaterial::SetRawSPKI | ( | const CPKIFBufferPtr & | key | ) |
Interface: Module
Set the public key material for this object
key | [in] a buffer containing a der-encoded subjectPublicKeyInfo structure |
Definition at line 124 of file PKIFCryptoPPKeyMaterial.cpp.
References BitsToBytes(), CACASNWRAPPER_CREATE, CPKIFAlgorithm::GetAlg(), m_hasParams, m_rawSPKI, PKIF_CRYPTOPP_RAW_IMPORT_FAILED, SetKeyAlg(), CPKIFKeyMaterial::SetSubjectPublicKeyInfo(), and TOOLKIT_CRYPTO_CRYPTOPPRAW.
void CPKIFCryptoPPKeyMaterial::SetKeyAlg | ( | const CPKIFAlgorithm * | alg | ) |
Interface: Module
Set the algorithm description for this object. The supplied algorithm description should be obtained using one of the static methods of the CPKIFAlgorithm class; it will not be freed here!
alg | [in] a pointer to a CPKIFAlgorithm object describing this key material |
Definition at line 164 of file PKIFCryptoPPKeyMaterial.cpp.
References m_alg.
Referenced by SetRawSPKI().
bool CPKIFCryptoPPKeyMaterial::HasParams | ( | ) | const |
Interface: Module
Definition at line 274 of file PKIFCryptoPPKeyMaterial.cpp.
References m_hasParams.
void CPKIFCryptoPPKeyMaterial::InitWithKeyMaterial | ( | const CPKIFKeyMaterial & | km | ) | [protected] |
Interface: Module
Definition at line 179 of file PKIFCryptoPPKeyMaterial.cpp.
References CPKIFKeyMaterial::GetCertificate(), CPKIFKeyMaterial::GetCertificateLength(), CPKIFKeyMaterial::GetSubjectPublicKeyInfo(), CPKIFKeyMaterial::GetWorkingParameters(), InitWithCert(), InitWithSPKI(), PKIF_CRYPTOPP_RAW_IMPORT_FAILED, CPKIFKeyMaterial::SetWorkingParameters(), and TOOLKIT_CRYPTO_CRYPTOPPRAW.
Referenced by CPKIFCryptoPPKeyMaterial().
void CPKIFCryptoPPKeyMaterial::InitWithSPKI | ( | CPKIFSubjectPublicKeyInfoPtr & | spki | ) | [protected] |
Interface: Module
Definition at line 205 of file PKIFCryptoPPKeyMaterial.cpp.
References CACASNWRAPPER_CREATE, ConvertStringToASN1OBJID(), CPKIFAlgorithm::GetAlg(), CPKIFKeyMaterial::GetWorkingParameters(), m_alg, m_hasParams, m_rawSPKI, and CPKIFKeyMaterial::SetSubjectPublicKeyInfo().
Referenced by CPKIFCryptoPPKeyMaterial(), InitWithCert(), and InitWithKeyMaterial().
void CPKIFCryptoPPKeyMaterial::InitWithCert | ( | const CPKIFCertificate & | cert | ) | [protected] |
Interface: Module
Definition at line 251 of file PKIFCryptoPPKeyMaterial.cpp.
References CPKIFCertificate::GetSubjectPublicKeyInfo(), and InitWithSPKI().
Referenced by CPKIFCryptoPPKeyMaterial(), and InitWithKeyMaterial().
CPKIFBufferPtr CPKIFCryptoPPKeyMaterial::m_rawSPKI [protected] |
Definition at line 52 of file PKIFCryptoPPKeyMaterial.h.
Referenced by GetRawSPKI(), InitWithSPKI(), and SetRawSPKI().
const CPKIFAlgorithm* CPKIFCryptoPPKeyMaterial::m_alg [protected] |
Definition at line 53 of file PKIFCryptoPPKeyMaterial.h.
Referenced by GetKeyAlg(), InitWithSPKI(), and SetKeyAlg().
bool CPKIFCryptoPPKeyMaterial::m_hasParams [protected] |
Definition at line 54 of file PKIFCryptoPPKeyMaterial.h.
Referenced by HasParams(), InitWithSPKI(), and SetRawSPKI().