GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
GpgFrontend::UI::KeyGenDialog Class Reference
Inheritance diagram for GpgFrontend::UI::KeyGenDialog:
Inheritance graph
Collaboration diagram for GpgFrontend::UI::KeyGenDialog:
Collaboration graph

Signals

void SignalKeyGenerated ()
 

Public Member Functions

 KeyGenDialog (QWidget *parent=nullptr)
 
- Public Member Functions inherited from GpgFrontend::UI::GeneralDialog
 GeneralDialog (std::string name, QWidget *parent=nullptr)
 

Private Slots

void slot_expire_box_changed ()
 
void slot_key_gen_accept ()
 
void slot_encryption_box_changed (int state)
 
void slot_signing_box_changed (int state)
 
void slot_certification_box_changed (int state)
 
void slot_authentication_box_changed (int state)
 
void slot_activated_key_type (int index)
 

Private Member Functions

QGroupBox * create_key_usage_group_box ()
 Create a key usage group box object. More...
 
QGroupBox * create_basic_info_group_box ()
 Create a basic info group box object. More...
 
void generate_key_dialog ()
 
void refresh_widgets_state ()
 
void set_signal_slot ()
 Set the signal slot object.
 
bool check_email_address (const QString &str)
 

Private Attributes

QRegularExpression re_email_
 
QStringList error_messages_
 
std::unique_ptr< GenKeyInfogen_key_info_
 
QDialogButtonBox * button_box_
 Box for standard buttons.
 
QLabel * error_label_ {}
 Label containing error message.
 
QLineEdit * name_edit_ {}
 Line edit for the keys name.
 
QLineEdit * email_edit_ {}
 Line edit for the keys email.
 
QLineEdit * comment_edit_ {}
 Line edit for the keys comment.
 
QLineEdit * passphrase_edit_ {}
 
QSpinBox * key_size_spin_box_ {}
 Spinbox for the keys size (in bit)
 
QComboBox * key_type_combo_box_ {}
 Combobox for Key type.
 
QDateTimeEdit * date_edit_ {}
 Date edit for expiration date.
 
QCheckBox * expire_check_box_ {}
 Checkbox, if key should expire.
 
QCheckBox * no_pass_phrase_check_box_ {}
 
QGroupBox * key_usage_group_box_ {}
 
QDateTime max_date_time_
 
std::vector< QCheckBox * > key_usage_check_boxes_
 ENCR, SIGN, CERT, AUTH.
 
bool use_pinentry_ = false
 

Additional Inherited Members

- Protected Member Functions inherited from GpgFrontend::UI::GeneralDialog
void setPosCenterOfScreen ()
 
void movePosition2CenterOfParent ()
 
bool isRectRestored ()
 
void showEvent (QShowEvent *event) override
 

Constructor & Destructor Documentation

◆ KeyGenDialog()

GpgFrontend::UI::KeyGenDialog::KeyGenDialog ( QWidget *  parent = nullptr)
explicit

Constructor of this class

Parameters
ctxThe current GpgME context
keyThe key to show details of
parentThe parent of this widget

References button_box_, GpgFrontend::UI::SignalStation::GetInstance(), GpgFrontend::SingletonFunctionObject< GlobalSettingStation >::GetInstance(), and GpgFrontend::GlobalSettingStation::LookupSettings().

Member Function Documentation

◆ check_email_address()

bool GpgFrontend::UI::KeyGenDialog::check_email_address ( const QString &  str)
private
Parameters
str
Returns
true
false

Referenced by slot_key_gen_accept().

◆ create_basic_info_group_box()

QGroupBox * GpgFrontend::UI::KeyGenDialog::create_basic_info_group_box ( )
private

◆ create_key_usage_group_box()

QGroupBox * GpgFrontend::UI::KeyGenDialog::create_key_usage_group_box ( )
private

Create a key usage group box object.

Returns
QGroupBox*

References key_usage_check_boxes_.

◆ refresh_widgets_state()

void GpgFrontend::UI::KeyGenDialog::refresh_widgets_state ( )
private

Refresh widgets state by GenKeyInfo

References key_size_spin_box_, and key_usage_check_boxes_.

Referenced by slot_activated_key_type().

◆ slot_activated_key_type

void GpgFrontend::UI::KeyGenDialog::slot_activated_key_type ( int  index)
privateslot
Parameters
index

References refresh_widgets_state().

Referenced by set_signal_slot().

◆ slot_authentication_box_changed

void GpgFrontend::UI::KeyGenDialog::slot_authentication_box_changed ( int  state)
privateslot
Parameters
state

Referenced by set_signal_slot().

◆ slot_certification_box_changed

void GpgFrontend::UI::KeyGenDialog::slot_certification_box_changed ( int  state)
privateslot
Parameters
state

Referenced by set_signal_slot().

◆ slot_encryption_box_changed

void GpgFrontend::UI::KeyGenDialog::slot_encryption_box_changed ( int  state)
privateslot
Parameters
state

Referenced by set_signal_slot().

◆ slot_expire_box_changed

void GpgFrontend::UI::KeyGenDialog::slot_expire_box_changed ( )
privateslot

when expirebox was checked/unchecked, enable/disable the expiration date box

References date_edit_, and expire_check_box_.

Referenced by set_signal_slot().

◆ slot_key_gen_accept

void GpgFrontend::UI::KeyGenDialog::slot_key_gen_accept ( )
privateslot

check all lineedits for false entries. Show error, when there is one, otherwise generate the key

check for errors in keygen dialog input

primary keys should have a reasonable expiration date (no more than 2 years in the future)

create the string for key generation

create error message

References check_email_address(), comment_edit_, date_edit_, email_edit_, error_label_, expire_check_box_, GpgFrontend::GpgKeyOpera::GenerateKey(), GpgFrontend::CoreCommonUtil::GetInstance(), GpgFrontend::SingletonFunctionObject< GpgKeyOpera >::GetInstance(), key_size_spin_box_, name_edit_, GpgFrontend::CoreCommonUtil::ResetTempCacheValue(), and GpgFrontend::CoreCommonUtil::SetTempCacheValue().

Referenced by set_signal_slot().

◆ slot_signing_box_changed

void GpgFrontend::UI::KeyGenDialog::slot_signing_box_changed ( int  state)
privateslot
Parameters
state

Referenced by set_signal_slot().

Member Data Documentation

◆ error_messages_

QStringList GpgFrontend::UI::KeyGenDialog::error_messages_
private

List of errors occurring when checking entries of line edits

◆ gen_key_info_

std::unique_ptr<GenKeyInfo> GpgFrontend::UI::KeyGenDialog::gen_key_info_
private
Initial value:
=
std::make_unique<GenKeyInfo>()

◆ key_usage_group_box_

QGroupBox* GpgFrontend::UI::KeyGenDialog::key_usage_group_box_ {}
private

Group of Widgets detecting the usage of the Key

◆ re_email_

QRegularExpression GpgFrontend::UI::KeyGenDialog::re_email_
private
Initial value:
{
R"((?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\]))"}

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