Class: TMD5

Declaration: MessageDigest.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TMessageDigest

Inherited By:

None.

Purpose:

The MD5 message digest algorithm has been constructed in response to some concern that the MD4 message digest algorithm might not be as secure as originally suspected. The MD5 algorithm is more computationally intensive than the MD4 algorithm and is therefore less efficient.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

None.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TMD5::TMD5

  1. TMD5 ()
  2. TMD5 (TPrimitiveTypeArray < unsigned char >& message)
  3. TMD5 (const TMD5 &)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Standard constructor use to create a digest.
  3. Copy constructor.

Calling Context:

  1. Called by the stream-in operators and clients that want to use the streaming digest (Write & Flush) member functions.
  2. Call this function directly.
  3. Called to copy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMD5::~TMD5

virtual ~ TMD5 ()

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: TMD5::operator=

TMD5 & operator =(const TMD5 &)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Called when an object is assigned to another compatible object.

Parameters:

Return Value:

A non-const reference to the left-hand side object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMD5::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: TMD5::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 version of the object is not recognized.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMD5::Write

virtual void Write (TPrimitiveTypeArray < unsigned char >& message)

Interface Category:

API.

Purpose:

Updates the message digest to include the digest of the specified message. This member function is useful for digesting very large messages where it would be impractical to present the whole message in one contiguous in-memory array. For example, each line in a file could be passed to Write individually without having to load the file into an in-memory array.

Calling Context:

Called by the client during a digest streaming operation.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMD5::Flush

virtual void Flush ()

Interface Category:

API.

Purpose:

Signals the end of the message and causes the message digest algorithm to post the message digest to the TMessageDigest base class. Flush is only required if the default constructor was used in conjunction with the Write member function. The TMD#(message) constructors perform the Flush operation automatically during construction.

Calling Context:

Called by the client at the end of a digest stream operation.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMD5::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 TMD5-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:

None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.