10Duke Enterprise C++ SDK
Loading...
Searching...
No Matches
tenduke::crypto::MessageDigest Class Referenceabstract

#include <MessageDigest.h>

Detailed Description

Simple MessageDigest-service: E.g.

a cryptographic hash function, MAC, or message signature.

Instances are not thread-safe.

Construction may throw tenduke::crypto::CryptoException.

Inheritance diagram for tenduke::crypto::MessageDigest:
tenduke::crypto::CryptographicHash tenduke::crypto::libcrypto::LibcryptoHash tenduke::crypto::win::cng::WinCNGHash

Public Member Functions

virtual std::size_t length () const =0
 Returns length (in bytes) of the resulting digest.
virtual MessageDigestupdate (const unsigned char *message, std::size_t messageLength)=0
 Updates the digest.
virtual void digestTo (unsigned char *messageDigest)=0
 Computes the digest to pre-allocated buffer.
virtual std::unique_ptr< tenduke::utl::BinaryDatadigest ()=0
 Computes the digest.

Member Function Documentation

◆ digest()

virtual std::unique_ptr< tenduke::utl::BinaryData > tenduke::crypto::MessageDigest::digest ( )
pure virtual

Computes the digest.

Returns
data-object containing the digest
Exceptions
tenduke::crypto::CryptoExceptionon error

Implemented in LibcryptoHash, tenduke::crypto::libcrypto::LibcryptoHash, tenduke::crypto::win::cng::WinCNGHash, and WinCNGHash.

◆ digestTo()

virtual void tenduke::crypto::MessageDigest::digestTo ( unsigned char * messageDigest)
pure virtual

Computes the digest to pre-allocated buffer.

Parameters
messageDigestthe computed digest is placed here (needs to proper size, use MessageDigest::length()).
Exceptions
tenduke::crypto::CryptoExceptionon error

Implemented in LibcryptoHash, tenduke::crypto::libcrypto::LibcryptoHash, tenduke::crypto::win::cng::WinCNGHash, and WinCNGHash.

◆ length()

virtual std::size_t tenduke::crypto::MessageDigest::length ( ) const
pure virtual

Returns length (in bytes) of the resulting digest.

Returns
-

Implemented in LibcryptoHash, tenduke::crypto::libcrypto::LibcryptoHash, tenduke::crypto::win::cng::WinCNGHash, and WinCNGHash.

◆ update()

virtual MessageDigest * tenduke::crypto::MessageDigest::update ( const unsigned char * message,
std::size_t messageLength )
pure virtual

Updates the digest.

Parameters
message-
messageLength-
Returns
this instance for chaining
Exceptions
tenduke::crypto::CryptoExceptionon error

Implemented in LibcryptoHash, tenduke::crypto::libcrypto::LibcryptoHash, tenduke::crypto::win::cng::WinCNGHash, and WinCNGHash.


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