Generates a password. More...
#include <pwgen.h>

Public Member Functions | |
| void | generatePassword (size_t len) throw (std::logic_error) |
| int | getCharacterPools () const |
| const char * | getPassword () const throw () |
| RNGENGINE | getRNGUsed () const |
| const PWGen & | operator= (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 | |
| CharacterPool * | cp |
| const char * | password |
| will hold the password. | |
| size_t | password_len |
| RNG * | rng |
Generates a more or less secure password depending on the character pool used.
Definition at line 53 of file pwgen.h.
| PWGen::PWGen | ( | int | p, | |
| RNGENGINE | rnge = AUTO | |||
| ) | throw (std::runtime_error) |
| PWGen::~PWGen | ( | ) | throw () [virtual] |
| 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().

| int YAPET::PWGEN::PWGen::getCharacterPools | ( | ) | const [inline] |
Definition at line 84 of file pwgen.h.
References cp, and YAPET::PWGEN::CharacterPool::getAllocatedPools().

| 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().


| 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().

| 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().


| void PWGen::init | ( | int | p, | |
| RNGENGINE | rnge | |||
| ) | throw (std::runtime_error) [private] |
| 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.

| void PWGen::setNewPool | ( | int | p | ) | throw (std::runtime_error) |
Definition at line 162 of file pwgen.cc.
Referenced by PWGenDialog::run().

| void PWGen::setNewRNG | ( | RNGENGINE | rnge | ) | throw (std::runtime_error) |
Definition at line 170 of file pwgen.cc.
Referenced by PWGenDialog::PWGenDialog().

CharacterPool* YAPET::PWGEN::PWGen::cp [private] |
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().
size_t YAPET::PWGEN::PWGen::password_len [private] |
Definition at line 65 of file pwgen.h.
Referenced by getPassword(), sanitize_password(), and ~PWGen().
RNG* YAPET::PWGEN::PWGen::rng [private] |
Definition at line 56 of file pwgen.h.
Referenced by getRNGUsed(), and ~PWGen().
1.7.1