messageDigest Class Reference

Computes message digests using standard algorithms, such as MD5 or SHA. More...

Inheritance diagram for messageDigest:
Inheritance graph
[legend]
Collaboration diagram for messageDigest:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual void update (const string &s)=0
virtual void update (const byte_t b)=0
virtual void update (const byte_t *buffer, const unsigned long len)=0
virtual void update (const byte_t *buffer, const unsigned long offset, const unsigned long len)=0
virtual void finalize ()=0
virtual void finalize (const string &s)=0
virtual void finalize (const byte_t *buffer, const unsigned long len)=0
virtual void finalize (const byte_t *buffer, const unsigned long offset, const unsigned long len)=0
virtual int getDigestLength () const =0
virtual const byte_tgetDigest () const =0
virtual const string getHexDigest () const
virtual void reset ()=0

Detailed Description

Computes message digests using standard algorithms, such as MD5 or SHA.


Member Function Documentation

virtual void finalize ( const byte_t buffer,
const unsigned long  offset,
const unsigned long  len 
) [pure virtual]

Completes the hash computation by performing final operations such as padding.

This is equivalent to calling update() and then finalize().

Implemented in sha1MessageDigest.

virtual void finalize ( const byte_t buffer,
const unsigned long  len 
) [pure virtual]

Completes the hash computation by performing final operations such as padding.

This is equivalent to calling update() and then finalize().

Implemented in sha1MessageDigest.

virtual void finalize ( const string s  )  [pure virtual]

Completes the hash computation by performing final operations such as padding.

This is equivalent to calling update() and then finalize().

Implemented in sha1MessageDigest.

virtual void finalize (  )  [pure virtual]

Completes the hash computation by performing final operations such as padding.

Implemented in sha1MessageDigest.

virtual const byte_t* getDigest (  )  const [pure virtual]

Returns the hash, as computed by the algorithm.

You must call finalize() before using this function, or the hash will not be correct. To get the size of the returned array, call getDigestLength().

Returns:
computed hash

Implemented in sha1MessageDigest.

Referenced by messageDigest::getHexDigest().

virtual int getDigestLength (  )  const [pure virtual]

Returns the length of the hash.

This is the length of the array returned by getDigest().

Returns:
length of computed hash

Implemented in sha1MessageDigest.

Referenced by messageDigest::getHexDigest().

const string getHexDigest (  )  const [virtual]

Returns the hash as an hexadecimal string.

You must call finalize() before using this function, or the hash will not be correct.

Returns:
computed hash, in hexadecimal format

References messageDigest::getDigest(), and messageDigest::getDigestLength().

virtual void reset (  )  [pure virtual]

Resets the algorithm to its initial state, so that you can compute a new hash using the same object.

Implemented in sha1MessageDigest.

virtual void update ( const byte_t buffer,
const unsigned long  offset,
const unsigned long  len 
) [pure virtual]

Updates the digest using the specified array of bytes, starting at the specified offset.

Parameters:
buffer array of bytes
offset offset to start from in the array of bytes
len number of bytes to use, starting at offset

Implemented in sha1MessageDigest.

virtual void update ( const byte_t buffer,
const unsigned long  len 
) [pure virtual]

Updates the digest using the specified array of bytes.

Parameters:
buffer array of bytes
len number of bytes to use in the buffer

Implemented in sha1MessageDigest.

virtual void update ( const byte_t  b  )  [pure virtual]

Updates the digest using the specified byte.

Parameters:
b the byte with which to update the digest.

Implemented in sha1MessageDigest.

virtual void update ( const string s  )  [pure virtual]

Updates the digest using the specified string.

Parameters:
s the string with which to update the digest.

Implemented in sha1MessageDigest.


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

Generated by  doxygen 1.6.2