Public Member Functions | Private Member Functions | Private Attributes

YAPET::PWGEN::PWGen Class Reference

Generates a password. More...

#include <pwgen.h>

Collaboration diagram for YAPET::PWGEN::PWGen:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void generatePassword (size_t len) throw (std::logic_error)
int getCharacterPools () const
const char * getPassword () const throw ()
RNGENGINE getRNGUsed () const
const PWGenoperator= (const PWGen &pw) throw ()
 PWGen (const PWGen &pw) throw ()
 PWGen (int p, RNGENGINE rnge=AUTO) throw (std::runtime_error)
 PWGen (SUBPOOLS p, RNGENGINE rnge=AUTO) throw (std::runtime_error)
void setNewPool (int p) throw (std::runtime_error)
void setNewRNG (RNGENGINE rnge) throw (std::runtime_error)
virtual ~PWGen () throw ()

Private Member Functions

char getCharFromUnusedPools () throw (std::logic_error)
void init (int p, RNGENGINE rnge) throw (std::runtime_error)
void sanitize_password () throw (std::logic_error)

Private Attributes

CharacterPoolcp
const char * password
 will hold the password.
size_t password_len
RNGrng

Detailed Description

Generates a more or less secure password depending on the character pool used.

See also:
CharacterPool

Definition at line 53 of file pwgen.h.


Constructor & Destructor Documentation

PWGen::PWGen ( SUBPOOLS  p,
RNGENGINE  rnge = AUTO 
) throw (std::runtime_error)

Definition at line 111 of file pwgen.cc.

PWGen::PWGen ( int  p,
RNGENGINE  rnge = AUTO 
) throw (std::runtime_error)

Definition at line 118 of file pwgen.cc.

PWGen::PWGen ( const PWGen pw  )  throw ()

Definition at line 128 of file pwgen.cc.

PWGen::~PWGen (  )  throw () [virtual]

Definition at line 146 of file pwgen.cc.

References cp, password, password_len, and rng.


Member Function Documentation

void PWGen::generatePassword ( size_t  len  )  throw (std::logic_error)

Definition at line 178 of file pwgen.cc.

Referenced by PWGenDialog::createWindow(), and PWGenDialog::run().

Here is the caller graph for this function:

int YAPET::PWGEN::PWGen::getCharacterPools (  )  const [inline]

Definition at line 84 of file pwgen.h.

References cp, and YAPET::PWGEN::CharacterPool::getAllocatedPools().

Here is the call graph for this function:

char PWGen::getCharFromUnusedPools (  )  throw (std::logic_error) [private]

Definition at line 67 of file pwgen.cc.

References cp, YAPET::PWGEN::CharacterPool::getAllocatedPools(), YAPET::PWGEN::CharacterPool::getPoolPos(), YAPET::PWGEN::CharacterPool::getPoolsWithRead(), YAPET::PWGEN::LETTERS, and YAPET::PWGEN::CharacterPool::numPoolsNotRead().

Referenced by sanitize_password().

Here is the call graph for this function:

Here is the caller graph for this function:

const char * PWGen::getPassword (  )  const throw ()

Definition at line 249 of file pwgen.cc.

References password, and password_len.

Referenced by PWGenDialog::createWindow(), and PWGenDialog::run().

Here is the caller graph for this function:

RNGENGINE YAPET::PWGEN::PWGen::getRNGUsed (  )  const [inline]

Definition at line 81 of file pwgen.h.

References YAPET::PWGEN::RNG::getRNGEngineUsed(), and rng.

Referenced by PWGenDialog::getNameOfRNG().

Here is the call graph for this function:

Here is the caller graph for this function:

void PWGen::init ( int  p,
RNGENGINE  rnge 
) throw (std::runtime_error) [private]

Definition at line 106 of file pwgen.cc.

const PWGen & PWGen::operator= ( const PWGen pw  )  throw ()

Definition at line 260 of file pwgen.cc.

void PWGen::sanitize_password (  )  throw (std::logic_error) [private]

If possible, replaces multiple characters from same pool with character from unused pools.

Use only on zero terminated passwords!

Definition at line 42 of file pwgen.cc.

References cp, YAPET::PWGEN::CharacterPool::fromPool(), getCharFromUnusedPools(), YAPET::PWGEN::CharacterPool::numPoolsAllocated(), YAPET::PWGEN::CharacterPool::numPoolsNotRead(), password, and password_len.

Here is the call graph for this function:

void PWGen::setNewPool ( int  p  )  throw (std::runtime_error)

Definition at line 162 of file pwgen.cc.

Referenced by PWGenDialog::run().

Here is the caller graph for this function:

void PWGen::setNewRNG ( RNGENGINE  rnge  )  throw (std::runtime_error)

Definition at line 170 of file pwgen.cc.

Referenced by PWGenDialog::PWGenDialog().

Here is the caller graph for this function:


Member Data Documentation

Definition at line 55 of file pwgen.h.

Referenced by getCharacterPools(), getCharFromUnusedPools(), sanitize_password(), and ~PWGen().

const char* YAPET::PWGEN::PWGen::password [private]

This will hold the (zero terminated) password. It is entierly managed by this class. When PWGen returns a password, it is always a pointer to this buffer.

Definition at line 64 of file pwgen.h.

Referenced by getPassword(), sanitize_password(), and ~PWGen().

Definition at line 65 of file pwgen.h.

Referenced by getPassword(), sanitize_password(), and ~PWGen().

Definition at line 56 of file pwgen.h.

Referenced by getRNGUsed(), and ~PWGen().


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