Class: TMessageDigest

Declaration: MessageDigest.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

MCollectible

Inherited By:

TMD4 TMD5

Purpose:

Abstract base class that is designed to capture the common characteristics of all message digest classes. A message digest algorithm is a one-way encryption engine that takes a message of any length and generates a coded pattern that is referred to as the digest of the message. Message digest algorithms are used for electronic signatures. The TMessageDigest class also allows polymorphism among message digest algorithms that are derived from the TMessageDigest base class. This enables products that use message digests to be coded independent of any particular algorithm.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

Derive to provide implementations of the various message digest algorithms. The GetDigestType and IsEqual member functions must be overridden for a complete implementation.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TMessageDigest::~TMessageDigest

virtual ~ TMessageDigest ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Called to destroy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMessageDigest::operator>>=

TStream & operator >>=(TStream & toWhere) const

Interface Category:

API.

Purpose:

Stream-out operator.

Calling Context:

Called to stream out data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself out to.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMessageDigest::operator<<=

TStream & operator <<= (TStream & fromWhere)

Interface Category:

API.

Purpose:

Stream-in operator.

Calling Context:

Called to stream in data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself in from.

Exceptions:

Throws TInvalidVersionError if the object's version is not recognized.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMessageDigest::GetMessageDigest

virtual void GetMessageDigest (TPrimitiveTypeArray <unsigned char>& array) const

Interface Category:

API.

Purpose:

Returns the array of unsigned chars that contains the message digest. The message digest is set by the derived algorithm when the encryption is complete. If the digest has not yet been set, the TPrimitiveTypeArray contains 0 values.

Calling Context:

Called by the product to extract the message digest array if needed.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMessageDigest::GetDigestType

virtual void GetDigestType (TStandardText & digestType) const

Interface Category:

API.

Purpose:

Gets a TStandardText object that uniquely identifies the underlying message digest algorithm. This member function is designed to offer RTTI-like services until RTTI is in place.

Calling Context:

Called by the holder of a TMessageDigest-based object that needs to know the identity of the underlying algorithm.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Must be overridden by the derived class to supply a unique identifier.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.