CppCMS
|
this class provides an API to calculate various cryptographic hash functions More...
#include <cppcms/crypto.h>
Public Member Functions | |
virtual unsigned | digest_size () const =0 |
virtual unsigned | block_size () const =0 |
virtual void | append (void const *ptr, size_t size)=0 |
virtual void | readout (void *ptr)=0 |
virtual message_digest * | clone () const =0 |
virtual char const * | name () const =0 |
Static Public Member Functions | |
static std::auto_ptr < message_digest > | md5 () |
static std::auto_ptr < message_digest > | sha1 () |
static std::auto_ptr < message_digest > | create_by_name (std::string const &name) |
Protected Member Functions | |
message_digest () | |
It should be implemented in derived classes. |
this class provides an API to calculate various cryptographic hash functions
virtual void cppcms::crypto::message_digest::append | ( | void const * | ptr, |
size_t | size | ||
) | [pure virtual] |
Add more data of size bytes for processing
virtual unsigned cppcms::crypto::message_digest::block_size | ( | ) | const [pure virtual] |
Get processing block size, returns 64 or 128, used mostly for correct HMAC calculations
virtual message_digest* cppcms::crypto::message_digest::clone | ( | ) | const [pure virtual] |
Make a polymorphic copy of this object, note the state of copied object is reset to initial
static std::auto_ptr<message_digest> cppcms::crypto::message_digest::create_by_name | ( | std::string const & | name | ) | [static] |
Create message digest by name, more then sha1 and md5 may be supported, if CppCMS is compiled with cryptography library like libgcrypt or openssl
virtual unsigned cppcms::crypto::message_digest::digest_size | ( | ) | const [pure virtual] |
Get the size of message digest, for example for MD5 it is 16, for SHA1 it is 20
static std::auto_ptr<message_digest> cppcms::crypto::message_digest::md5 | ( | ) | [static] |
Create MD5 message digest
virtual char const* cppcms::crypto::message_digest::name | ( | ) | const [pure virtual] |
Get the name of the hash function
virtual void cppcms::crypto::message_digest::readout | ( | void * | ptr | ) | [pure virtual] |
Read the message digest for the data and reset it into initial state, provided buffer must be digest_size() bytes
static std::auto_ptr<message_digest> cppcms::crypto::message_digest::sha1 | ( | ) | [static] |
Create SHA1 message digest