GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
GpgFrontend::PassphraseGenerator Class Reference

The PassphraseGenerator class. More...

#include <PassphraseGenerator.h>

Inheritance diagram for GpgFrontend::PassphraseGenerator:
Inheritance graph
Collaboration diagram for GpgFrontend::PassphraseGenerator:
Collaboration graph

Public Member Functions

 PassphraseGenerator (int channel=SingletonFunctionObject::GetDefaultChannel())
 PassphraseGenerator constructor. More...
 
auto Generate (int len) -> QString
 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.
 
auto operator= (const SingletonFunctionObject< PassphraseGenerator > &) -> SingletonFunctionObject &=delete
 prohibit copy More...
 
void operator= (const PassphraseGenerator &)=delete
 
auto GetChannel () const -> int
 Get the Channel object. More...
 
- Public Member Functions inherited from GpgFrontend::ChannelObject
 ChannelObject () noexcept
 Construct a new Default Channel Object object.
 
virtual ~ChannelObject () noexcept
 Destroy the Channel Object object.
 
 ChannelObject (int channel, QString type)
 Construct a new Channel Object object. More...
 
auto GetChannel () const -> int
 Get the Channel object. More...
 
void SetChannel (int channel)
 Set the Channel object. More...
 

Private 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 auto GetInstance (int channel=GpgFrontend::kGpgFrontendDefaultChannel) -> PassphraseGenerator &
 Get the Instance object. More...
 
static auto CreateInstance (int channel, const std::function< ChannelObjectPtr(void)> &factory) -> PassphraseGenerator &
 Create a Instance object. More...
 
static void ReleaseChannel (int channel)
 
static auto GetDefaultChannel () -> int
 Get the Default Channel object. More...
 
static auto GetAllChannelId () -> std::vector< int >
 Get all the channel ids. More...
 
- Static Public Member Functions inherited from GpgFrontend::ChannelObject
static auto GetDefaultChannel () -> int
 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.
 

Detailed Description

The PassphraseGenerator class.

This class is used to generate a passphrase.

Constructor & Destructor Documentation

◆ PassphraseGenerator()

GpgFrontend::PassphraseGenerator::PassphraseGenerator ( int  channel = SingletonFunctionObject::GetDefaultChannel())
inlineexplicit

PassphraseGenerator constructor.

Parameters
channelThe channel to use

Member Function Documentation

◆ Generate()

auto GpgFrontend::PassphraseGenerator::Generate ( int  len) -> QString

generate passphrase

Parameters
lenlength of the passphrase
Returns
QString passphrase

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