#include <PKIFAlgorithm.h>
TSP-enforcing: No
Definition at line 24 of file PKIFAlgorithm.h.
Public Member Functions | |
CPKIFAlgorithm (const std::string &description, PKIFCRYPTO::HASH_ALG alg, int digestsize) | |
CPKIFAlgorithm (const std::string &description, PKIFCRYPTO::SYMKEY_ALG alg, PKIFCRYPTO::SYMKEY_MODE mode, int keylen, int blocksize) | |
CPKIFAlgorithm (const std::string &description, PKIFCRYPTO::ASYMKEY_ALG alg) | |
CPKIFAlgorithm (const std::string &description, PKIFCRYPTO::ASYMKEY_ALG ka, PKIFCRYPTO::HASH_ALG ha) | |
CPKIFAlgorithm (void) | |
~CPKIFAlgorithm (void) | |
const std::string & | Description (void) const |
int | BlockSize (void) const |
int | DigestSize (void) const |
int | KeySize (void) const |
bool | NeedsIV (void) const |
PKIFCRYPTO::HASH_ALG | HashAlg (void) const |
PKIFCRYPTO::SYMKEY_ALG | SymkeyAlg (void) const |
PKIFCRYPTO::SYMKEY_MODE | SymkeyMode (void) const |
PKIFCRYPTO::ASYMKEY_ALG | AsymkeyAlg (void) const |
CPKIFOIDPtr | OID (void) const |
Static Public Member Functions | |
static CPKIFAlgorithm * | GetAlg (PKIFCRYPTO::HASH_ALG alg) |
static CPKIFAlgorithm * | GetAlg (PKIFCRYPTO::SYMKEY_ALG alg, PKIFCRYPTO::SYMKEY_MODE mode=PKIFCRYPTO::ECB) |
static CPKIFAlgorithm * | GetAlg (PKIFCRYPTO::ASYMKEY_ALG alg) |
static CPKIFAlgorithm * | GetAlg (CPKIFOIDPtr oid) |
static void | init (void) |
CPKIFAlgorithm::CPKIFAlgorithm | ( | const std::string & | description, | |
PKIFCRYPTO::HASH_ALG | alg, | |||
int | digestsize | |||
) |
Interface: External
This is a constructor which creates CPKIFAlgorithm obejct for hash algorithms
description | [in] std::string object which describes cryto algorithm |
alg | [in] HASH_ALG enum which identifies the hash algorithm |
digestsize | [in] Digest size |
Definition at line 104 of file PKIFAlgorithm.cpp.
CPKIFAlgorithm::CPKIFAlgorithm | ( | const std::string & | description, | |
PKIFCRYPTO::SYMKEY_ALG | alg, | |||
PKIFCRYPTO::SYMKEY_MODE | mode, | |||
int | keylen, | |||
int | blocksize | |||
) |
Interface: External
This is a constructor which creates CPKIFAlgorithm obejct for symmetric algorithms
description | [in] std::string object which describes cryto algorithm |
alg | [in] SYMKEY_ALG enum which identifies the sym algorithm |
mode | [in] SYMKEY_MODE enum which identifies the sym algorithm mode |
keylen | [in] Integer which indicates key length |
blocksize | [in] Integer which indicates block size; |
Definition at line 124 of file PKIFAlgorithm.cpp.
CPKIFAlgorithm::CPKIFAlgorithm | ( | const std::string & | description, | |
PKIFCRYPTO::ASYMKEY_ALG | alg | |||
) |
Interface: External
This is a constructor which creates CPKIFAlgorithm obejct for asymmetric algorithms
description | [in] std::string object which describes cryto algorithm |
alg | [in] ASYMKEY_ALG enum which identifies the asym algorithm |
Definition at line 150 of file PKIFAlgorithm.cpp.
CPKIFAlgorithm::CPKIFAlgorithm | ( | const std::string & | description, | |
PKIFCRYPTO::ASYMKEY_ALG | ka, | |||
PKIFCRYPTO::HASH_ALG | ha | |||
) |
Interface: External
This is a constructor which creates CPKIFAlgorithm objects for signature algorithms
description | [in] std::string which describes signature algorithm |
ka | [in] ASYMKEY_ALG which identifies the type of keypair used to produce the signature |
ha | [in] HASH_ALG which identifies the digest used with the signature |
Definition at line 168 of file PKIFAlgorithm.cpp.
CPKIFAlgorithm::CPKIFAlgorithm | ( | void | ) |
Interface: External
Default constructor
Definition at line 188 of file PKIFAlgorithm.cpp.
CPKIFAlgorithm::~CPKIFAlgorithm | ( | void | ) |
Interface: External
Default destructor
Definition at line 199 of file PKIFAlgorithm.cpp.
References PKIFDelete().
CPKIFAlgorithm * CPKIFAlgorithm::GetAlg | ( | PKIFCRYPTO::HASH_ALG | alg | ) | [static] |
Interface: External
This function returns CPKIFAlgorithm object assosiated with requested hash algorithm
alg | [in] ASYMKEY_ALG enum which identifies the hash algorithm |
Definition at line 211 of file PKIFAlgorithm.cpp.
References init(), PKIFCRYPTO::MD5, PKIFCRYPTO::SHA1, PKIFCRYPTO::SHA256, PKIFCRYPTO::SHA384, and PKIFCRYPTO::SHA512.
Referenced by _MakeCredentialFromP8File(), CalculateHashOfArchiveTimestampChain(), CertReferenceMatchesCertificate(), CPKIFCryptoPPRaw::CryptFunc(), CPKIFCryptoPPRaw::CryptInit(), CPKIFCAPIRaw::CryptInit(), PKIFXSECCryptoSymmetricKey::decrypt(), PKIFXSECCryptoSymmetricKey::decryptInit(), PKIFXSECCryptoSymmetricKey::encrypt(), PKIFXSECCryptoSymmetricKey::encryptInit(), GetCACHashAlg(), GetCACSymAlg(), PKIFXSECCryptoX509::getPublicKeyType(), GetSignerInfo(), GetSymmetricKey(), CPKIFCryptoPPKeyMaterial::InitWithSPKI(), CPKIFCryptoPP::SecretAgree(), CPKIFESSCertId::SetCertificate(), CPKIFCryptoPPKeyMaterial::SetRawSPKI(), CPKIFCryptoPPRaw::SupportsAlgorithm(), UnwrapSymmKey(), CPKIFEvidenceRecordVerifier::Verify(), CPKIFCryptoPPRaw::VerifyCertificate(), VerifyCertificateWithCryptoPP(), VerifyCounterSignatures(), and WrapSymmKey().
CPKIFAlgorithm * CPKIFAlgorithm::GetAlg | ( | PKIFCRYPTO::SYMKEY_ALG | alg, | |
PKIFCRYPTO::SYMKEY_MODE | mode = PKIFCRYPTO::ECB | |||
) | [static] |
Interface: External
This function returns CPKIFAlgorithm object assosiated with requested sym algorithm and mode
alg | [in] SYMKEY_ALG enum which identifies the sym algorithm |
mode | [in] SYMKEY_MODE enum which identifies the sym algorithm mode |
Definition at line 247 of file PKIFAlgorithm.cpp.
References PKIFCRYPTO::AES, PKIFCRYPTO::AES128, PKIFCRYPTO::AES128Wrap, PKIFCRYPTO::AES192, PKIFCRYPTO::AES192Wrap, PKIFCRYPTO::AES256, PKIFCRYPTO::AES256Wrap, PKIFCRYPTO::DES, PKIFCRYPTO::ECB, init(), and PKIFCRYPTO::TDES.
CPKIFAlgorithm * CPKIFAlgorithm::GetAlg | ( | PKIFCRYPTO::ASYMKEY_ALG | alg | ) | [static] |
Interface: External
This function returns CPKIFAlgorithm object assosiated with requested asym algorithm
alg | [in] SYMKEY_ALG enum which identifies the asym algorithm |
Definition at line 295 of file PKIFAlgorithm.cpp.
References PKIFCRYPTO::DSS, PKIFCRYPTO::ECC, init(), and PKIFCRYPTO::RSA.
CPKIFAlgorithm * CPKIFAlgorithm::GetAlg | ( | CPKIFOIDPtr | oid | ) | [static] |
Interface: External
This function returns CPKIFAlgorithm object assosiated with requested OID
oid | [in] A smart pointer to CPKIFOID object |
Definition at line 325 of file PKIFAlgorithm.cpp.
References g_aes128CBC, g_aes128ECB, g_aes128Wrap, g_aes192CBC, g_aes192ECB, g_aes192Wrap, g_aes256CBC, g_aes256ECB, g_aes256Wrap, g_desCBC, g_desECB, g_dsa, g_dsaWithSHA1, g_dsaWithSHA1Alternative, g_ecc, g_ecdh_std_sha256kdf, g_ecdh_std_sha384kdf, g_ecdsa_sha1, g_ecdsa_sha224, g_ecdsa_sha256, g_ecdsa_sha384, g_ecdsa_sha512, g_md5, g_md5WithRSAEncryption, g_rsa, g_sha1, g_sha1WithRSAEncryption, g_sha224, g_sha224WithRSAEncryption, g_sha256, g_sha256WithRSAEncryption, g_sha384, g_sha384WithRSAEncryption, g_sha512, g_sha512WithRSAEncryption, g_tdesCBC, g_tdesECB, and init().
void CPKIFAlgorithm::init | ( | void | ) | [static] |
Interface: External
This function initializes OIDs
Definition at line 397 of file PKIFAlgorithm.cpp.
References g_aes128CBC, g_aes128ECB, g_aes128Wrap, g_aes192CBC, g_aes192ECB, g_aes192Wrap, g_aes256CBC, g_aes256ECB, g_aes256Wrap, g_desCBC, g_desECB, g_dsa, g_dsaWithSHA1, g_ecc, g_ecdh_std_sha256kdf, g_ecdh_std_sha384kdf, g_ecdsa_sha1, g_ecdsa_sha224, g_ecdsa_sha256, g_ecdsa_sha384, g_ecdsa_sha512, g_md5, g_md5WithRSAEncryption, g_rsa, g_sha1, g_sha1WithRSAEncryption, g_sha224, g_sha224WithRSAEncryption, g_sha256, g_sha256WithRSAEncryption, g_sha384, g_sha384WithRSAEncryption, g_sha512, g_sha512WithRSAEncryption, g_tdesCBC, g_tdesECB, and m_impl.
Referenced by GetAlg().
const std::string & CPKIFAlgorithm::Description | ( | void | ) | const |
Interface: External
This function returns the description of the algorithm
Definition at line 454 of file PKIFAlgorithm.cpp.
int CPKIFAlgorithm::BlockSize | ( | void | ) | const |
Interface: External
This function returns the block size for an algorithm
Definition at line 465 of file PKIFAlgorithm.cpp.
Referenced by CPKIFCryptoPPRaw::CryptFunc(), CPKIFCAPIRaw::CryptInit(), PKIFXSECCryptoSymmetricKey::decrypt(), PKIFXSECCryptoSymmetricKey::decryptInit(), PKIFXSECCryptoSymmetricKey::encrypt(), PKIFXSECCryptoSymmetricKey::encryptInit(), UnwrapSymmKey(), and WrapSymmKey().
int CPKIFAlgorithm::DigestSize | ( | void | ) | const |
Interface: External
This function returns the digest size for an algorithm
Definition at line 476 of file PKIFAlgorithm.cpp.
Referenced by CalculateHashOfArchiveTimestampChain(), CertReferenceMatchesCertificate(), CPKIFCryptoPP::DeriveKey(), GetSignerInfo(), HashBuffer(), CPKIFESSCertId::SetCertificate(), and VerifyCounterSignatures().
int CPKIFAlgorithm::KeySize | ( | void | ) | const |
Interface: External
This function returns the key size for an algorithm
Definition at line 487 of file PKIFAlgorithm.cpp.
Referenced by GetSymmetricKey().
bool CPKIFAlgorithm::NeedsIV | ( | void | ) | const |
Interface: External
This function determines if IV is needed
Definition at line 509 of file PKIFAlgorithm.cpp.
References PKIFCRYPTO::CBC, PKIFCRYPTO::CFB64, PKIFCRYPTO::CFB8, PKIFCRYPTO::ECB, PKIFCRYPTO::OFB64, and PKIFCRYPTO::OFB8.
Referenced by PKIFXSECCryptoSymmetricKey::decrypt(), CPKIFEnvelopedData::Decrypt(), PKIFXSECCryptoSymmetricKey::encrypt(), and PKIFXSECCryptoSymmetricKey::encryptInit().
PKIFCRYPTO::HASH_ALG CPKIFAlgorithm::HashAlg | ( | void | ) | const |
Interface: External
This function returns hash algorithm
Definition at line 534 of file PKIFAlgorithm.cpp.
Referenced by CertReferenceMatchesCertificate(), ComputeSignedAttrHash(), CPKIFCryptoPP::DeriveKey(), GetCACHashAlg(), HashBuffer(), CPKIFESSCertId::SetCertificate(), CPKIFEvidenceRecordVerifier::Verify(), CPKIFCryptoPPRaw::VerifyCertificate(), and VerifyCertificateWithCryptoPP().
PKIFCRYPTO::SYMKEY_ALG CPKIFAlgorithm::SymkeyAlg | ( | void | ) | const |
Interface: External
This function returns sym algorithm
Definition at line 545 of file PKIFAlgorithm.cpp.
Referenced by CPKIFEnvelopedData::Decrypt(), GetSymmetricKey(), UnwrapSymmKey(), and WrapSymmKey().
PKIFCRYPTO::SYMKEY_MODE CPKIFAlgorithm::SymkeyMode | ( | void | ) | const |
Interface: External
This function returns sym algorithm mode
Definition at line 556 of file PKIFAlgorithm.cpp.
Referenced by CPKIFEnvelopedData::Decrypt(), GetSymmetricKey(), UnwrapSymmKey(), and WrapSymmKey().
PKIFCRYPTO::ASYMKEY_ALG CPKIFAlgorithm::AsymkeyAlg | ( | void | ) | const |
Interface: External
This function returns asym algorithm mode
Definition at line 567 of file PKIFAlgorithm.cpp.
Referenced by CPKIFCryptoPPCredential::GetPublicKey(), PKIFXSECCryptoX509::getPublicKeyType(), CPKIFCryptoPP::Sign(), and CPKIFCryptoPPRaw::SupportsAlgorithm().
CPKIFOIDPtr CPKIFAlgorithm::OID | ( | void | ) | const |
Interface: External
This function returns an OID for an algorithm
Definition at line 498 of file PKIFAlgorithm.cpp.
Referenced by CPKIFCryptoPP::DeriveKey(), GetCACHashAlg(), GetCACSymAlg(), CPKIFCryptoPP::SecretAgree(), UnwrapSymmKey(), and WrapSymmKey().