GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
|
The PassphraseGenerator class. More...
#include <PassphraseGenerator.h>
Public Member Functions | |
PassphraseGenerator (int channel=SingletonFunctionObject::GetDefaultChannel()) | |
PassphraseGenerator constructor. More... | |
std::string | Generate (int len) |
generate passphrase More... | |
Public Member Functions inherited from GpgFrontend::SingletonFunctionObject< PassphraseGenerator > | |
SingletonFunctionObject (const SingletonFunctionObject< PassphraseGenerator > &)=delete | |
prohibit copy | |
SingletonFunctionObject (PassphraseGenerator &&)=delete | |
Construct a new Singleton Function Object object. | |
SingletonFunctionObject (const PassphraseGenerator &)=delete | |
Construct a new Singleton Function Object object. | |
SingletonFunctionObject & | operator= (const SingletonFunctionObject< PassphraseGenerator > &)=delete |
prohibit copy More... | |
void | operator= (const PassphraseGenerator &)=delete |
int | GetChannel () const |
Get the Channel object. More... | |
Public Member Functions inherited from GpgFrontend::ChannelObject | |
ChannelObject () noexcept | |
Construct a new Default Channel Object object. | |
ChannelObject (int channel) | |
Construct a new Channel Object object. More... | |
int | GetChannel () const |
Get the Channel object. More... | |
void | SetChannel (int channel) |
Set the Channel object. More... | |
Public Attributes | |
std::random_device | rd_ |
Random device. | |
std::mt19937 | mt_ = std::mt19937(rd_()) |
Mersenne twister. | |
Additional Inherited Members | |
Static Public Member Functions inherited from GpgFrontend::SingletonFunctionObject< PassphraseGenerator > | |
static PassphraseGenerator & | GetInstance (int channel=GpgFrontend::GPGFRONTEND_DEFAULT_CHANNEL) |
Get the Instance object. More... | |
static PassphraseGenerator & | CreateInstance (int channel, std::function< std::unique_ptr< ChannelObject >(void)> factory) |
Create a Instance object. More... | |
static void | ReleaseChannel (int channel) |
static int | GetDefaultChannel () |
Get the Default Channel object. More... | |
static std::vector< int > | GetAllChannelId () |
Get all the channel ids. More... | |
Static Public Member Functions inherited from GpgFrontend::ChannelObject | |
static int | GetDefaultChannel () |
Get the Default Channel object. More... | |
Protected Member Functions inherited from GpgFrontend::SingletonFunctionObject< PassphraseGenerator > | |
SingletonFunctionObject ()=default | |
Construct a new Singleton Function Object object. | |
SingletonFunctionObject (int channel) | |
Construct a new Singleton Function Object object. More... | |
virtual | ~SingletonFunctionObject ()=default |
Destroy the Singleton Function Object object. | |
The PassphraseGenerator class.
This class is used to generate a passphrase.
|
inlineexplicit |
PassphraseGenerator constructor.
channel | The channel to use |
|
inline |
generate passphrase
len | length of the passphrase |
Referenced by GpgFrontend::KeyPackageOperator::GeneratePassphrase().