namespace Akenti class MessageDigest : public ref_ptr<MessageDigestImpl>

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

Inheritance:


Public Methods

MessageDigest (MessageDigestImpl* impl = NULL)
Constructs a MessageDigest given a MessageDigestImpl object
~MessageDigest ()
Destroys this object
static MessageDigest getInstance (const string& alg)
Returns a MessageDigest object given the name of an algorithm specified by alg
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

Inherited from ref_ptr:

Public Methods

ref_ptr & operator=(const ref_ptr& rhs)
T* operator->() const
operator void*() const
T* get() const

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) { ... }
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&)

~MessageDigest()
Destroys this object.
See Also:
ref_ptr

static 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&)

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.
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)


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 hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de