Wolframe, 0.0.3

_Wolframe::AAAA::PasswordChangeMessage Class Reference

Password changer data structure. More...

#include <pwdChangeMessage.hpp>

Public Member Functions

 PasswordChangeMessage (const std::string &pwd)
 
 PasswordChangeMessage (const unsigned char msg[64])
 
 PasswordChangeMessage ()
 
 ~PasswordChangeMessage ()
 
void clear ()
 
unsigned char * data ()
 
std::size_t size () const
 
std::string password () const
 
bool isValid () const
 Check if the message is valid. More...
 
std::string toBase64 (const unsigned char IV[16], const unsigned char key[32]) const
 Encrypt the message to a base64 string. More...
 
bool fromBase64 (const std::string &msg, const unsigned char IV[16], const unsigned char key[32])
 Build the message from an encrypted base64 message. More...
 

Static Public Member Functions

static bool isValid (const unsigned char buffer[64])
 Check if the buffer is a valid message. More...
 
static bool isValid (const unsigned char buffer[], std::size_t size)
 

Private Types

enum  { PASSWORD_MAX_LENGTH = 64 - sizeof( unsigned char ) - MD5_DIGEST_SIZE, PAYLOAD_LENGTH = 64 - MD5_DIGEST_SIZE }
 

Private Attributes

union {
   unsigned char   data [64]
 
   struct {
      unsigned char   length
 
      char   passwd [PASSWORD_MAX_LENGTH]
 
      unsigned char   digest [MD5_DIGEST_SIZE]
 
   }   parts
 
m_message
 

Detailed Description

Password changer data structure.

Member Enumeration Documentation

anonymous enum
private
Enumerator
PASSWORD_MAX_LENGTH 
PAYLOAD_LENGTH 

Constructor & Destructor Documentation

_Wolframe::AAAA::PasswordChangeMessage::PasswordChangeMessage ( const std::string &  pwd)
_Wolframe::AAAA::PasswordChangeMessage::PasswordChangeMessage ( const unsigned char  msg[64])
_Wolframe::AAAA::PasswordChangeMessage::PasswordChangeMessage ( )
inline

Empty message constructor

Note
that this is an invalid message
_Wolframe::AAAA::PasswordChangeMessage::~PasswordChangeMessage ( )
inline

Member Function Documentation

void _Wolframe::AAAA::PasswordChangeMessage::clear ( )
inline
unsigned char* _Wolframe::AAAA::PasswordChangeMessage::data ( )
inline
bool _Wolframe::AAAA::PasswordChangeMessage::fromBase64 ( const std::string &  msg,
const unsigned char  IV[16],
const unsigned char  key[32] 
)

Build the message from an encrypted base64 message.

static bool _Wolframe::AAAA::PasswordChangeMessage::isValid ( const unsigned char  buffer[64])
inlinestatic

Check if the buffer is a valid message.

static bool _Wolframe::AAAA::PasswordChangeMessage::isValid ( const unsigned char  buffer[],
std::size_t  size 
)
static
bool _Wolframe::AAAA::PasswordChangeMessage::isValid ( ) const
inline

Check if the message is valid.

std::string _Wolframe::AAAA::PasswordChangeMessage::password ( ) const
inline
std::size_t _Wolframe::AAAA::PasswordChangeMessage::size ( ) const
inline
std::string _Wolframe::AAAA::PasswordChangeMessage::toBase64 ( const unsigned char  IV[16],
const unsigned char  key[32] 
) const

Encrypt the message to a base64 string.

Member Data Documentation

unsigned char _Wolframe::AAAA::PasswordChangeMessage::data[64]
unsigned char _Wolframe::AAAA::PasswordChangeMessage::digest[MD5_DIGEST_SIZE]
unsigned char _Wolframe::AAAA::PasswordChangeMessage::length
union { ... } _Wolframe::AAAA::PasswordChangeMessage::m_message
struct { ... } _Wolframe::AAAA::PasswordChangeMessage::parts
char _Wolframe::AAAA::PasswordChangeMessage::passwd[PASSWORD_MAX_LENGTH]

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