class Akenti::MessageDigest

A MessageDigest object is a reference-count pointer that wraps a MessageDigestImpl object.

Inheritance:


Public Methods

[more] MessageDigest (MessageDigestImpl* impl = NULL)
Constructs a MessageDigest given a MessageDigestImpl object.
[more] ~MessageDigest ()
Destroys this object.
[more]static MessageDigest getInstance (const string& alg)
Returns a MessageDigest object given the name of an algorithm specified by alg.
[more]static string digest (const string &alg, const string &data)
A convenient method that returns a hash given the name of an algorithm specified by alg and the string to be hashed specified by data.
[more]static MessageDigest getNullDigest ()
Returns a Null Digest engine


Documentation

A MessageDigest object is a reference-count pointer that wraps a MessageDigestImpl object. It provides applications, albeit indirectly, with the functionality of a message digest algorithm such as MD5 or SHA1. Message digests are secure one-way hash functions that take arbitrary-sized data and output a fixed-length hash value.

  * Usage: 
  *      try {
  *        MessageDigest md = MessageDigest::getInstance("MD5");
  *
  *        md->update("Message");
  *        md->update("Digest");
  *
  *        string hash = md->digest();
  *      } catch(SecurityException e) { ... }
  * 

o MessageDigest(MessageDigestImpl* impl = NULL)
Constructs a MessageDigest given a MessageDigestImpl object. Typically the getInstance(const string&) method is used to create an instance of this class.

Parameters:
impl - wrapped MessageDigestImpl object
See Also:
ref_ptr
MessageDigestImpl
getInstance(const string&)

o ~MessageDigest()
Destroys this object.

See Also:
ref_ptr

ostatic MessageDigest getInstance(const string& alg)
Returns a MessageDigest object given the name of an algorithm specified by alg.

Throws:
SecurityException if algorithm is not supported
Parameters:
- alg string name of the algorithm
See Also:
getProvider()
getMessageDigest(const string&)

ostatic string digest(const string &alg, const string &data)
A convenient method that returns a hash given the name of an algorithm specified by alg and the string to be hashed specified by data.

Throws:
Error if provider has not been installed
SecurityException if algorithm is not supported
Parameters:
- alg string name of the algorithm
data - string to be hasheD
See Also:
getInstance(const string& alg)

ostatic MessageDigest getNullDigest()
Returns a Null Digest engine


This class has no child classes.
Author:
Srilekha Mudumbai Abdelilah Essiari
Version:
1.1 00/05/01
See Also:
ref_ptr
MessageDigestImpl
getProvider()
getMessageDigest(const string&)

Alphabetic index HTML hierarchy of classes or Java



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