#include <ParallelHash.h>
TSP-enforcing: No
Definition at line 53 of file ParallelHash.h.
Public Member Functions | |
CPKIFParallelHash () | |
virtual | ~CPKIFParallelHash () |
void | SetDigestAlgs (IPKIFCryptoMisc *cMisc, CPKIFBufferPtr digestAlgsBuf) |
void | SetDigestAlgs (IPKIFCryptoMisc *cMisc, CCACDigestAlgorithmIdentifiers &digestAlgs) |
void | UpdateMessage (IPKIFCryptoMisc *cMisc, unsigned char *buf, int bufLen) |
void | FinalizeHashes (IPKIFCryptoMisc *cMisc) |
HashInfo * | GetHashInfo (PKIFCRYPTO::HASH_ALG alg) |
void | FreeHashVector () |
void | SetIgnoreUnsupportedAlgs (bool b) |
CPKIFParallelHash::CPKIFParallelHash | ( | ) |
Interface: External
This function creates and initializes a new CPKIFParallelHash object. This function initializes the IgnoreUnsupportedAlgs property to true, i.e. unrecognized hash algorithms will not result in failure.
Definition at line 46 of file ParallelHash.cpp.
References LOG_STRING_DEBUG, and TOOLKIT_CRYPTO_MISC.
CPKIFParallelHash::~CPKIFParallelHash | ( | ) | [virtual] |
Interface: External
This function destroys an instance of CPKIFParallelHash object.
Definition at line 61 of file ParallelHash.cpp.
References FreeHashVector(), LOG_STRING_DEBUG, and TOOLKIT_CRYPTO_MISC.
void CPKIFParallelHash::SetDigestAlgs | ( | IPKIFCryptoMisc * | cMisc, | |
CPKIFBufferPtr | digestAlgsBuf | |||
) |
Interface: External
This function is typically called following construction of an instance and must be called prior to calling UpdateMessage for each desired algorithm. Once UpdateMessage has been called, additional hash algorithms may not be added until the object is reset by a call to FreeHashVectors. This function may generate an exception containing the following error code MSG_INVALID_STATE.
CACCMSDigestAlgorithmIdentifiers is simply a typedef for DList. CCACDigestAlgorithmIdentifiers is a typedef for a vector containing CPKIFAlgorithmIdentifier objects.
CPKIFMessageException(COMMON_INVALID_INPUT) | ||
CPKIFMessageException(COMMON_UNSUPPORTED_ALG) | ||
CPKIFMessageException(MSG_INVALID_STATE) |
cMisc | [in] A pointer to a hash provider. |
digestAlgsBuf | [in] A null terminated list of the algorithm ids to use for hashing. |
Definition at line 168 of file ParallelHash.cpp.
References CACASNWRAPPER_CREATE, COMMON_INVALID_INPUT, COMMON_UNSUPPORTED_ALG, FreeHashVector(), GetCACHashAlg(), IPKIFCryptoMisc::HashInit(), LOG_STRING_DEBUG, HashInfo::m_hashAlg, HashInfo::m_hashContext, MSG_INVALID_STATE, and TOOLKIT_CRYPTO_MISC.
void CPKIFParallelHash::SetDigestAlgs | ( | IPKIFCryptoMisc * | cMisc, | |
CCACDigestAlgorithmIdentifiers & | digestAlgs | |||
) |
Interface: External
This function is typically called following construction of an instance and must be called prior to calling UpdateMessage for each desired algorithm. Once UpdateMessage has been called, additional hash algorithms may not be added until the object is reset by a call to FreeHashVectors. This function may generate an exception containing the following error code MSG_INVALID_STATE.
CACCMSDigestAlgorithmIdentifiers is simply a typedef for DList. CCACDigestAlgorithmIdentifiers is a typedef for a vector containing CPKIFAlgorithmIdentifier objects.
CPKIFMessageException(COMMON_INVALID_INPUT) | ||
CPKIFMessageException(COMMON_UNSUPPORTED_ALG) | ||
CPKIFMessageException(MSG_INVALID_STATE) |
cMisc | [in] A pointer to a hash provider. |
digestAlgs | [in] A null terminated list of the algorithm ids to use for hashing. |
Definition at line 87 of file ParallelHash.cpp.
References COMMON_INVALID_INPUT, COMMON_UNSUPPORTED_ALG, FreeHashVector(), GetCACHashAlg(), IPKIFCryptoMisc::HashInit(), LOG_STRING_DEBUG, HashInfo::m_hashAlg, HashInfo::m_hashContext, MSG_INVALID_STATE, and TOOLKIT_CRYPTO_MISC.
void CPKIFParallelHash::UpdateMessage | ( | IPKIFCryptoMisc * | cMisc, | |
unsigned char * | buf, | |||
int | bufLen | |||
) |
Interface: External
This function is typically called following construction of an instance and must be called prior to calling UpdateMessage for each desired algorithm. Once UpdateMessage has been called, additional hash algorithms may not be added until the object is reset by a call to FreeHashVectors. This function may generate an exception containing the following error code MSG_INVALID_STATE.
CACCMSDigestAlgorithmIdentifiers is simply a typedef for DList. CCACDigestAlgorithmIdentifiers is a typedef for a vector containing CPKIFAlgorithmIdentifier objects.
CPKIFMessageException(COMMON_INVALID_INPUT) | ||
CPKIFMessageException(COMMON_UNSUPPORTED_ALG) | ||
CPKIFMessageException(MSG_INVALID_STATE) | Interface: External |
CPKIFMessageException(MSG_INVALID_STATE) |
cMisc | [in] A pointer to an IPKIFCryptoMisc used for hash functionality |
buf | [in] A pointer to a buffer containing the content to hash |
bufLen | [in] An integer containing the length of the data passed via buf |
Definition at line 334 of file ParallelHash.cpp.
References IPKIFCryptoMisc::HashUpdate(), LOG_STRING_DEBUG, MSG_INVALID_STATE, and TOOLKIT_CRYPTO_MISC.
void CPKIFParallelHash::FinalizeHashes | ( | IPKIFCryptoMisc * | cMisc | ) |
Interface: External
This function is called to finalize a running hash. It returns the message digest calculated over the data passed to UpdateMessage.
CPKIFMessageException(COMMON_INVALID_INPUT) |
cMisc | [in] A pointer to an IPKIFCryptoMisc used for hash functionality |
Definition at line 372 of file ParallelHash.cpp.
References COMMON_INVALID_INPUT, IPKIFCryptoMisc::HashFinal(), LOG_STRING_DEBUG, MAXHASH, and TOOLKIT_CRYPTO_MISC.
HashInfo * CPKIFParallelHash::GetHashInfo | ( | PKIFCRYPTO::HASH_ALG | alg | ) |
Interface: External
This function returns a pointer to a HashInfo object containing the message digest generated using the algorithm identified by the alg parameter.
alg | [in] HASH_ALG value indicating the HashInfo object to return |
Definition at line 408 of file ParallelHash.cpp.
References LOG_STRING_DEBUG, and TOOLKIT_CRYPTO_MISC.
void CPKIFParallelHash::FreeHashVector | ( | ) |
Interface: External
This function must be called to reset the state of the object when object reuse is desired.
Definition at line 433 of file ParallelHash.cpp.
References LOG_STRING_DEBUG, and TOOLKIT_CRYPTO_MISC.
Referenced by SetDigestAlgs(), and ~CPKIFParallelHash().
void CPKIFParallelHash::SetIgnoreUnsupportedAlgs | ( | bool | b | ) |
Interface: External
This function can be called to set the flag that determines if unsupported hash algorithms cause a failure. By default, unsupported hash algorithms are ignored (this class is currently only used by CMS components and an unknown hash algorithm will trigger other failures unrelated this class). In cases where this value is set to false and an unrecognized hash function is used, an error will be generated when the associated signature is verified (if the signature is not verified, the lack of support for the hash algorithm is a non-issue). Setting this value set to false enables processing of signers who use supported hash algorithms. If this value is set to true, processing of a SignedData message will fail immediately when an unsupported hash algorithm is encountered.
b | [b] Boolean value indicating whether unsupported algorithms should be ignored (i.e. not generate an error) |
Definition at line 470 of file ParallelHash.cpp.