oasys::MD5 Class Reference

#include <MD5.h>

List of all members.


Detailed Description

Simple wrapper class to calculate an MD5 digest.

Definition at line 36 of file MD5.h.


Public Member Functions

 MD5 ()
 ~MD5 ()
void init ()
void update (const u_char *data, size_t len)
void update (const char *data, size_t len)
void finalize ()
const u_char * digest ()
void digest_ascii (std::string *str)
std::string digest_ascii ()

Static Public Member Functions

static void digest_ascii (std::string *str, const u_char *digest)
static std::string digest_ascii (const u_char *digest)
static void digest_fromascii (const char *str, u_char *digest)

Static Public Attributes

static const unsigned int MD5LEN = 16

Private Attributes

MD5_CTX ctx_
u_char digest_ [MD5LEN]

Constructor & Destructor Documentation

oasys::MD5::MD5 (  ) 

Definition at line 21 of file MD5.cc.

References init().

oasys::MD5::~MD5 (  )  [inline]

Definition at line 41 of file MD5.h.


Member Function Documentation

void oasys::MD5::init (  ) 

MD5 initialization. Begins an MD5 operation, writing a new context.

Definition at line 28 of file MD5.cc.

References ctx_, and MD5Init().

Referenced by MD5().

void oasys::MD5::update ( const u_char *  data,
size_t  len 
)

Update the md5 hash with data bytes

Definition at line 35 of file MD5.cc.

References ctx_, and MD5Update().

Referenced by dtn::GlobalStore::calc_digest(), and main().

void oasys::MD5::update ( const char *  data,
size_t  len 
)

Update the md5 hash with data bytes

Definition at line 42 of file MD5.cc.

References ctx_, and MD5Update().

void oasys::MD5::finalize (  ) 

Finish up the md5 hashing process

Definition at line 49 of file MD5.cc.

References ctx_, digest_, and MD5Final().

Referenced by dtn::GlobalStore::calc_digest(), and main().

const u_char * oasys::MD5::digest (  ) 

Returns:
MD5 hash value.

Definition at line 56 of file MD5.cc.

References digest_.

Referenced by dtn::GlobalStore::calc_digest().

void oasys::MD5::digest_ascii ( std::string *  str,
const u_char *  digest 
) [static]

Returns:
MD5 hash value in ascii, std::string varient

Definition at line 63 of file MD5.cc.

References oasys::hex2str(), and MD5LEN.

Referenced by dtn::GlobalStore::calc_digest(), and main().

std::string oasys::MD5::digest_ascii ( const u_char *  digest  )  [static]

Returns:
MD5 hash value in ascii

Definition at line 71 of file MD5.cc.

References digest_ascii().

void oasys::MD5::digest_ascii ( std::string *  str  ) 

Returns:
MD5 hash value in ascii

Definition at line 80 of file MD5.cc.

References digest_, and digest_ascii().

std::string oasys::MD5::digest_ascii (  ) 

Returns:
MD5 hash value in ascii, std::string varient

Definition at line 87 of file MD5.cc.

References digest_.

Referenced by digest_ascii().

void oasys::MD5::digest_fromascii ( const char *  str,
u_char *  digest 
) [static]

Obtain the digest from ascii

Definition at line 94 of file MD5.cc.

References MD5LEN, and oasys::str2hex().


Member Data Documentation

const unsigned int oasys::MD5::MD5LEN = 16 [static]

Definition at line 38 of file MD5.h.

Referenced by dtn::GlobalStore::calc_digest(), digest_ascii(), digest_fromascii(), dtn::GlobalStore::load(), oasys::MD5Hash_t::operator=(), and oasys::MD5Hash_t::serialize().

MD5_CTX oasys::MD5::ctx_ [private]

Definition at line 74 of file MD5.h.

Referenced by finalize(), init(), and update().

u_char oasys::MD5::digest_[MD5LEN] [private]

Definition at line 75 of file MD5.h.

Referenced by digest(), digest_ascii(), and finalize().


The documentation for this class was generated from the following files:
Generated on Sat Sep 8 08:36:26 2007 for DTN Reference Implementation by  doxygen 1.5.3