class Akenti::MessageDigestImpl

This abstract class provides applications with the interface of a message digest algorithm, such as MD5 or SHA1.

Inheritance:


Public Methods

[more]virtual ~MessageDigestImpl ()
Deletes this object
[more]const string& getAlgorithm () const
Returns a string that identifies the algorithm, independent of implementation details.
[more]void update (const string& data, int offset, int len)
Updates the engine using the specified number of bytes, starting at the specified offset in the data string.
[more]void update (const string& data)
Updates the engine using the specified string of bytes.
[more]string digest ()
Completes the hash computation.
[more]virtual void reset ()
Resets the digest to the initial state of no data

Protected Fields

[more]string alg

Protected Methods

[more] MessageDigestImpl (const string& alg)
Constructs this object.
[more]virtual void doUpdate (const string& data, int offset, int len)
Updates the digest using the specified number of bytes, starting at the specified offset.
[more]virtual string doDigest ()
Returns the hash.


Documentation

This abstract class provides applications with the interface of a message digest algorithm, such as MD5 or SHA1. It also provides some of the functionality. The rest of the functionality is to be provided by the subclass implementors. Typically the clients will not deal with an instance of this class directly. Instead they interact with the MessageDigest reference-count pointer.

A MessageDigestImpl object starts out in an initial state containing no data. Data is added to the digest object using the update methods. At any point the reset method can be called to reset the digest to the initial state of no data. Once all the data has been updated, one of the digest methods should be called to complete the hash computation. After digest has been called, the MessageDigestImpl object is reset to its initialized state.

ovirtual ~MessageDigestImpl()
Deletes this object

oconst string& getAlgorithm() const
Returns a string that identifies the algorithm, independent of implementation details. The name should be a standard name such as "MD5".

Returns:
name of the algorithm

ovoid update(const string& data, int offset, int len)
Updates the engine using the specified number of bytes, starting at the specified offset in the data string.

Throws:
Error if input buffer too short
Parameters:
data - input string of bytes.
offset - the offset in data to start from
len - the number of bytes to use starting at offset.
See Also:
doUpdate(const string&)

ovoid update(const string& data)
Updates the engine using the specified string of bytes.

Parameters:
data - string to be updated.
See Also:
doUpdate(const string&)

ostring digest()
Completes the hash computation.

Returns:
a string of bytes for the resulting hash value.

ovirtual void reset()
Resets the digest to the initial state of no data

o MessageDigestImpl(const string& alg)
Constructs this object.

ovirtual void doUpdate(const string& data, int offset, int len)
Updates the digest using the specified number of bytes, starting at the specified offset. Subclass implementors need not do any error checking since the update methods make sure that the arguments are valid.

Parameters:
input - string of bytes.
offset - the offset to start from.
len - the number of bytes to use starting at offset.
See Also:
update(const string&)
update(const string&, int, int)

ovirtual string doDigest()
Returns the hash.

ostring alg


Direct child classes:
OpenSSLMessageDigestImpl
Friends:
class MessageDigest
Author:
Srilekha Mudumbai Abdelilah Essiari
Version:
1.1 00/05/01
See Also:
MessageDigest
getProvider()
getMessageDigest(const string&)
Error

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.