VMime
messageDigest Class Referenceabstract
Inheritance diagram for messageDigest:
Collaboration diagram for messageDigest:

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 size_t len)=0
 
virtual void update (const byte_t *buffer, const size_t offset, const size_t len)=0
 
virtual void finalize ()=0
 
virtual void finalize (const string &s)=0
 
virtual void finalize (const byte_t *buffer, const size_t len)=0
 
virtual void finalize (const byte_t *buffer, const size_t offset, const size_t len)=0
 
virtual size_t getDigestLength () const =0
 
virtual const byte_tgetDigest () const =0
 
virtual const string getHexDigest () const
 
virtual void reset ()=0
 

Additional Inherited Members

- Protected Member Functions inherited from object
 object ()
 
 object (const object &)
 
objectoperator= (const object &)
 
virtual ~object ()
 

Detailed Description

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

Member Function Documentation

virtual void finalize ( )
pure virtual

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

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 ( const byte_t buffer,
const size_t  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 size_t  offset,
const size_t  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 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 size_t 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 string s)
pure virtual

Updates the digest using the specified string.

Parameters
sthe string with which to update the digest.

Implemented in sha1MessageDigest.

virtual void update ( const byte_t  b)
pure virtual

Updates the digest using the specified byte.

Parameters
bthe byte with which to update the digest.

Implemented in sha1MessageDigest.

virtual void update ( const byte_t buffer,
const size_t  len 
)
pure virtual

Updates the digest using the specified array of bytes.

Parameters
bufferarray of bytes
lennumber of bytes to use in the buffer

Implemented in sha1MessageDigest.

virtual void update ( const byte_t buffer,
const size_t  offset,
const size_t  len 
)
pure virtual

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

Parameters
bufferarray of bytes
offsetoffset to start from in the array of bytes
lennumber of bytes to use, starting at offset

Implemented in sha1MessageDigest.


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