CPKIFAlgorithm Class Reference

#include <PKIFAlgorithm.h>

Collaboration diagram for CPKIFAlgorithm:

Collaboration graph
[legend]

List of all members.


Detailed Description

The CPKIFAlgorithm class provides an easy way to identify cryto algorithms.

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 CPKIFAlgorithmGetAlg (PKIFCRYPTO::HASH_ALG alg)
static CPKIFAlgorithmGetAlg (PKIFCRYPTO::SYMKEY_ALG alg, PKIFCRYPTO::SYMKEY_MODE mode=PKIFCRYPTO::ECB)
static CPKIFAlgorithmGetAlg (PKIFCRYPTO::ASYMKEY_ALG alg)
static CPKIFAlgorithmGetAlg (CPKIFOIDPtr oid)
static void init (void)

Constructor & Destructor Documentation

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

Returns:
None
Parameters:
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

Returns:
None
Parameters:
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

Returns:
None
Parameters:
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

Returns:
None
Parameters:
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

Returns:
None

Definition at line 188 of file PKIFAlgorithm.cpp.

CPKIFAlgorithm::~CPKIFAlgorithm ( void   ) 

Interface: External

Default destructor

Returns:
None

Definition at line 199 of file PKIFAlgorithm.cpp.

References PKIFDelete().


Member Function Documentation

CPKIFAlgorithm * CPKIFAlgorithm::GetAlg ( PKIFCRYPTO::HASH_ALG  alg  )  [static]

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

Returns:
A pointer to CPKIFAlgorithm object which identifies the requested algorithm
Parameters:
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

Returns:
A pointer to CPKIFAlgorithm object which identifies the requested algorithm
Parameters:
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]

void CPKIFAlgorithm::init ( void   )  [static]

const std::string & CPKIFAlgorithm::Description ( void   )  const

Interface: External

This function returns the description of the algorithm

Returns:
std::string containing 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

Returns:
An integer indicating block size

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

Returns:
An integer indicating digest size

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

Returns:
An integer indicating key size

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

Returns:
True if IV is needed, False otherwise

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

PKIFCRYPTO::SYMKEY_ALG CPKIFAlgorithm::SymkeyAlg ( void   )  const

Interface: External

This function returns sym algorithm

Returns:
SYMKEY_ALG enum identifying the sym alg

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

Returns:
SYMKEY_MODE enum identifying the sym alg 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

Returns:
ASYMKEY_ALG enum identifying the asym alg

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

Returns:
A smart pointer to CPKIFOID object

Definition at line 498 of file PKIFAlgorithm.cpp.

Referenced by CPKIFCryptoPP::DeriveKey(), GetCACHashAlg(), GetCACSymAlg(), CPKIFCryptoPP::SecretAgree(), UnwrapSymmKey(), and WrapSymmKey().


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

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