Wolframe, 0.0.3

_Wolframe::AAAA::PasswordHash Class Reference

Password hash. More...

#include <passwordHash.hpp>

Classes

class  Hash
 
class  Salt
 

Public Member Functions

 PasswordHash ()
 Construct an empty password hash. More...
 
 PasswordHash (const crypto::RandomGenerator &rndGen, const std::string &password)
 
 PasswordHash (const unsigned char *pwdSalt, size_t bytes, const std::string &password)
 
 PasswordHash (const Salt &pwdSalt, const std::string &password)
 
 PasswordHash (const std::string &pwdSalt, const std::string &password)
 
 PasswordHash (const std::string &str)
 
const Saltsalt () const
 The password salt. More...
 
const Hashhash () const
 The unsigned char vector of the password hash. More...
 
std::string toBCD () const
 
std::string toString () const
 

Private Attributes

Hash m_hash
 
Salt m_salt
 

Detailed Description

Password hash.

Constructor & Destructor Documentation

_Wolframe::AAAA::PasswordHash::PasswordHash ( )
inline

Construct an empty password hash.

_Wolframe::AAAA::PasswordHash::PasswordHash ( const crypto::RandomGenerator rndGen,
const std::string &  password 
)

Construct the password hash with a random salt

Parameters
rndGenthe random number generator
passwordpassword as plain text
_Wolframe::AAAA::PasswordHash::PasswordHash ( const unsigned char *  pwdSalt,
size_t  bytes,
const std::string &  password 
)

Construct the password hash from salt and password (plain text)

Parameters
pwdSaltpassword salt as bytes
bytespassword salt length in bytes
passwordpassword as plain text
_Wolframe::AAAA::PasswordHash::PasswordHash ( const Salt pwdSalt,
const std::string &  password 
)

Construct the password hash from salt and password (plain text)

Parameters
pwdSaltpassword salt as PasswordHash::Salt
passwordpassword as plain text
_Wolframe::AAAA::PasswordHash::PasswordHash ( const std::string &  pwdSalt,
const std::string &  password 
)

Construct the password hash from salt and password (plain text)

Parameters
pwdSaltpassword salt as a base64 string
passwordpassword as plain text
_Wolframe::AAAA::PasswordHash::PasswordHash ( const std::string &  str)

Construct the password hash from a combined password hash string (base64)

Parameters
strpassword hash string in format $<salt>$<hash> if the string doesn't start with '$' then the string is considered to represent only the password hash as base64 and the salt will be zeroed

Member Function Documentation

const Hash& _Wolframe::AAAA::PasswordHash::hash ( ) const
inline

The unsigned char vector of the password hash.

const Salt& _Wolframe::AAAA::PasswordHash::salt ( ) const
inline

The password salt.

std::string _Wolframe::AAAA::PasswordHash::toBCD ( ) const

Return the password hash as a BCD string. The format is $<salt>$<hash> on one line, no whitespaces.

std::string _Wolframe::AAAA::PasswordHash::toString ( ) const

Return the password hash as a base64 string without base64 padding. The format is $<salt>$<hash> on one line, no whitespaces.

Member Data Documentation

Hash _Wolframe::AAAA::PasswordHash::m_hash
private
Salt _Wolframe::AAAA::PasswordHash::m_salt
private

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