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

Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
GpgFrontend::GenKeyInfo Class Reference
Collaboration diagram for GpgFrontend::GenKeyInfo:

## Public Member Functions
bool | IsSubKey () const
void | SetIsSubKey (bool m_sub_key)
| Set the Is Sub Key object. More...
std::string | GetUserid () const
| Get the Userid object. More...
void | SetName (const std::string &m_name)
| Set the Name object. More...
void | SetEmail (const std::string &m_email)
| Set the Email object. More...
void | SetComment (const std::string &m_comment)
| Set the Comment object. More...
std::string | GetName () const
| Get the Name object. More...
std::string | GetEmail () const
| Get the Email object. More...
std::string | GetComment () const
| Get the Comment object. More...
const std::string & | GetAlgo () const
| Get the Algo object. More...
void | SetAlgo (const std::string &m_algo)
| Set the Algo object. More...
std::string | GetKeySizeStr () const
| Get the Key Size Str object. More...
int | GetKeyLength () const
| Get the Key Size object. More...
void | SetKeyLength (int m_key_size)
| Set the Key Size object. More...
const boost::posix_time::ptime & | GetExpireTime () const
| Get the Expired object. More...
void | SetExpireTime (const boost::posix_time::ptime &m_expired)
| Set the Expired object. More...
bool | IsNonExpired () const
void | SetNonExpired (bool m_non_expired)
| Set the Non Expired object. More...
bool | IsNoPassPhrase () const
void | SetNonPassPhrase (bool m_non_pass_phrase)
| Set the Non Pass Phrase object. More...
bool | IsAllowSigning () const
bool | IsAllowNoPassPhrase () const
void | SetAllowSigning (bool m_allow_signing)
| Set the Allow Signing object. More...
bool | IsAllowEncryption () const
void | SetAllowEncryption (bool m_allow_encryption)
| Set the Allow Encryption object. More...
bool | IsAllowCertification () const
void | SetAllowCertification (bool m_allow_certification)
| Set the Allow Certification object. More...
bool | IsAllowAuthentication () const
void | SetAllowAuthentication (bool m_allow_authentication)
| Set the Allow Authentication object. More...
const std::string & | GetPassPhrase () const
| Get the Pass Phrase object. More...
void | SetPassPhrase (const std::string &m_pass_phrase)
| Set the Pass Phrase object. More...
bool | IsAllowChangeSigning () const
bool | IsAllowChangeEncryption () const
bool | IsAllowChangeCertification () const
bool | IsAllowChangeAuthentication () const
int | GetSuggestMaxKeySize () const
| Get the Suggest Max Key Size object. More...
int | GetSuggestMinKeySize () const
| Get the Suggest Min Key Size object. More...
int | GetSizeChangeStep () const
| Get the Size Change Step object. More...
| GenKeyInfo (bool m_is_sub_key=false, bool m_standalone=false)
| Construct a new Gen Key Info object. More...

## Static Public Member Functions
static const std::vector< std::string > & | GetSupportedKeyAlgo ()
| Get the Supported Key Algo object. More...
static const std::vector< std::string > & | GetSupportedSubkeyAlgo ()
| Get the Supported Subkey Algo object. More...
static const std::vector< std::string > & | GetSupportedKeyAlgoStandalone ()
| Get the Supported Key Algo Standalone object. More...
static const std::vector< std::string > & | GetSupportedSubkeyAlgoStandalone ()
| Get the Supported Subkey Algo Standalone object. More...

## Private Member Functions
void | reset_options ()

## Private Attributes
bool | standalone_ = false
bool | subkey_ = false
std::string | name_
std::string | email_
std::string | comment_
std::string | algo_
int | key_size_ = 2048
boost::posix_time::ptime | expired_
bool | non_expired_ = false
bool | no_passphrase_ = false
bool | allow_no_pass_phrase_ = true
int | suggest_max_key_size_ = 4096
int | suggest_size_addition_step_ = 1024
int | suggest_min_key_size_ = 1024
std::string | passphrase_
bool | allow_encryption_ = true
bool | allow_change_encryption_ = true
bool | allow_certification_ = true
bool | allow_change_certification_ = true
bool | allow_authentication_ = true
bool | allow_change_authentication_ = true
bool | allow_signing_ = true
bool | allow_change_signing_ = true

## Constructor & Destructor Documentation

## ◆ GenKeyInfo()

GpgFrontend::GenKeyInfo::GenKeyInfo | ( | bool | m_is_sub_key = `false`,
|  | bool | m_standalone = `false`
| ) |  |
| explicit

Construct a new Gen Key Info object.

Parameters

  m_is_sub_key |
  m_standalone |

References SetAlgo().

## Member Function Documentation

## ◆ GetAlgo()

const std::string& GpgFrontend::GenKeyInfo::GetAlgo | ( |  | ) | const
| inline

Get the Algo object.

Returns
  const std::string&

Referenced by GpgFrontend::GpgKeyOpera::GenerateKey(), and GpgFrontend::GpgKeyOpera::GenerateSubkey().

## ◆ GetComment()

std::string GpgFrontend::GenKeyInfo::GetComment | ( |  | ) | const
| inline

Get the Comment object.

Returns
  std::string

## ◆ GetEmail()

std::string GpgFrontend::GenKeyInfo::GetEmail | ( |  | ) | const
| inline

Get the Email object.

Returns
  std::string

## ◆ GetExpireTime()

const boost::posix_time::ptime& GpgFrontend::GenKeyInfo::GetExpireTime | ( |  | ) | const
| inline

Get the Expired object.

Returns
  const boost::posix_time::ptime&

## ◆ GetKeyLength()

int GpgFrontend::GenKeyInfo::GetKeyLength | ( |  | ) | const
| inline

Get the Key Size object.

Returns
  int

## ◆ GetKeySizeStr()

std::string GpgFrontend::GenKeyInfo::GetKeySizeStr | ( |  | ) | const

Get the Key Size Str object.

Returns
  std::string

Referenced by GpgFrontend::GpgKeyOpera::GenerateKey(), and GpgFrontend::GpgKeyOpera::GenerateSubkey().

## ◆ GetName()

std::string GpgFrontend::GenKeyInfo::GetName | ( |  | ) | const
| inline

Get the Name object.

Returns
  std::string

## ◆ GetPassPhrase()

const std::string& GpgFrontend::GenKeyInfo::GetPassPhrase | ( |  | ) | const
| inline

Get the Pass Phrase object.

Returns
  const std::string&

## ◆ GetSizeChangeStep()

int GpgFrontend::GenKeyInfo::GetSizeChangeStep | ( |  | ) | const
| inline

Get the Size Change Step object.

Returns
  int

## ◆ GetSuggestMaxKeySize()

int GpgFrontend::GenKeyInfo::GetSuggestMaxKeySize | ( |  | ) | const
| inline

Get the Suggest Max Key Size object.

Returns
  int

## ◆ GetSuggestMinKeySize()

int GpgFrontend::GenKeyInfo::GetSuggestMinKeySize | ( |  | ) | const
| inline

Get the Suggest Min Key Size object.

Returns
  int

## ◆ GetSupportedKeyAlgo()

const std::vector< std::string > & GpgFrontend::GenKeyInfo::GetSupportedKeyAlgo | ( |  | ) |
| static

Get the Supported Key Algo object.

Returns
  const std::vector<std::string>&

Referenced by GpgFrontend::UI::KeyGenDialog::create_basic_info_group_box(), GpgFrontend::UI::SubkeyGenerateDialog::create_basic_info_group_box(), and SetAlgo().

## ◆ GetSupportedKeyAlgoStandalone()

const std::vector< std::string > & GpgFrontend::GenKeyInfo::GetSupportedKeyAlgoStandalone | ( |  | ) |
| static

Get the Supported Key Algo Standalone object.

Returns
  const std::vector<std::string>&

Referenced by SetAlgo().

## ◆ GetSupportedSubkeyAlgo()

const std::vector< std::string > & GpgFrontend::GenKeyInfo::GetSupportedSubkeyAlgo | ( |  | ) |
| static

Get the Supported Subkey Algo object.

Returns
  const std::vector<std::string>&

Referenced by SetAlgo().

## ◆ GetSupportedSubkeyAlgoStandalone()

const std::vector< std::string > & GpgFrontend::GenKeyInfo::GetSupportedSubkeyAlgoStandalone | ( |  | ) |
| static

Get the Supported Subkey Algo Standalone object.

Returns
  const std::vector<std::string>&

Referenced by SetAlgo().

## ◆ GetUserid()

std::string GpgFrontend::GenKeyInfo::GetUserid | ( |  | ) | const
| inline

Get the Userid object.

Returns
  std::string

Referenced by GpgFrontend::GpgKeyOpera::GenerateKey().

## ◆ IsAllowAuthentication()

bool GpgFrontend::GenKeyInfo::IsAllowAuthentication | ( |  | ) | const
| inline

Returns
  true
  false

## ◆ IsAllowCertification()

bool GpgFrontend::GenKeyInfo::IsAllowCertification | ( |  | ) | const
| inline

Returns
  true
  false

## ◆ IsAllowChangeAuthentication()

bool GpgFrontend::GenKeyInfo::IsAllowChangeAuthentication | ( |  | ) | const
| inline

Returns
  true
  false

## ◆ IsAllowChangeCertification()

bool GpgFrontend::GenKeyInfo::IsAllowChangeCertification | ( |  | ) | const
| inline

Returns
  true
  false

## ◆ IsAllowChangeEncryption()

bool GpgFrontend::GenKeyInfo::IsAllowChangeEncryption | ( |  | ) | const
| inline

Returns
  true
  false

## ◆ IsAllowChangeSigning()

bool GpgFrontend::GenKeyInfo::IsAllowChangeSigning | ( |  | ) | const
| inline

Returns
  true
  false

## ◆ IsAllowEncryption()

bool GpgFrontend::GenKeyInfo::IsAllowEncryption | ( |  | ) | const
| inline

Returns
  true
  false

## ◆ IsAllowNoPassPhrase()

bool GpgFrontend::GenKeyInfo::IsAllowNoPassPhrase | ( |  | ) | const
| inline

Returns
  true
  false

## ◆ IsAllowSigning()

bool GpgFrontend::GenKeyInfo::IsAllowSigning | ( |  | ) | const
| inline

Returns
  true
  false

## ◆ IsNonExpired()

bool GpgFrontend::GenKeyInfo::IsNonExpired | ( |  | ) | const
| inline

Returns
  true
  false

## ◆ IsNoPassPhrase()

bool GpgFrontend::GenKeyInfo::IsNoPassPhrase | ( |  | ) | const
| inline

Returns
  true
  false

## ◆ IsSubKey()

bool GpgFrontend::GenKeyInfo::IsSubKey | ( |  | ) | const
| inline

Returns
  true
  false

Referenced by GpgFrontend::GpgKeyOpera::GenerateSubkey().

## ◆ SetAlgo()

void GpgFrontend::GenKeyInfo::SetAlgo | ( | const std::string & | m_algo | ) |

Set the Algo object.

Parameters

  m_algo | Copyright (C) 2021 Saturneric

This file is part of GpgFrontend.

GpgFrontend is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

GpgFrontend is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with GpgFrontend. If not, see https://www.gnu.org/licenses/.

The initial version of the source code is inherited from the gpg4usb project, which is under GPL-3.0-or-later.

All the source code of GpgFrontend was modified and released by Saturnericeric@.nosp@m.bktu.nosp@m.s.com starting on May 12, 2021.

SPDX-License-Identifier: GPL-3.0-or-later

RSA is the world’s premier asymmetric cryptographic algorithm, and is built on the difficulty of factoring extremely large composites. GnuPG supports RSA with key sizes of between 1024 and 4096 bits.

Algorithm (DSA) as a government standard for digital signatures. Originally, it supported key lengths between 512 and 1024 bits. Recently, NIST has declared 512-bit keys obsolete: now, DSA is available in 1024, 2048 and 3072-bit lengths.

GnuPG supports the Elgamal asymmetric encryption algorithm in key lengths ranging from 1024 to 4096 bits.

GnuPG supports the Elgamal asymmetric encryption algorithm in key lengths ranging from 1024 to 4096 bits.

References GetSupportedKeyAlgo(), GetSupportedKeyAlgoStandalone(), GetSupportedSubkeyAlgo(), GetSupportedSubkeyAlgoStandalone(), SetAllowAuthentication(), SetAllowCertification(), SetAllowEncryption(), SetAllowSigning(), and SetKeyLength().

Referenced by GenKeyInfo().

## ◆ SetAllowAuthentication()

void GpgFrontend::GenKeyInfo::SetAllowAuthentication | ( | bool | m_allow_authentication | ) |
| inline

Set the Allow Authentication object.

Parameters

  m_allow_authentication |

Referenced by SetAlgo().

## ◆ SetAllowCertification()

void GpgFrontend::GenKeyInfo::SetAllowCertification | ( | bool | m_allow_certification | ) |

Set the Allow Certification object.

Parameters

  m_allow_certification |

Referenced by SetAlgo().

## ◆ SetAllowEncryption()

void GpgFrontend::GenKeyInfo::SetAllowEncryption | ( | bool | m_allow_encryption | ) |

Set the Allow Encryption object.

Parameters

  m_allow_encryption |

Referenced by SetAlgo().

## ◆ SetAllowSigning()

void GpgFrontend::GenKeyInfo::SetAllowSigning | ( | bool | m_allow_signing | ) |
| inline

Set the Allow Signing object.

Parameters

  m_allow_signing |

Referenced by SetAlgo().

## ◆ SetComment()

void GpgFrontend::GenKeyInfo::SetComment | ( | const std::string & | m_comment | ) |
| inline

Set the Comment object.

Parameters

  m_comment |

## ◆ SetEmail()

void GpgFrontend::GenKeyInfo::SetEmail | ( | const std::string & | m_email | ) |
| inline

Set the Email object.

Parameters

  m_email |

## ◆ SetExpireTime()

void GpgFrontend::GenKeyInfo::SetExpireTime | ( | const boost::posix_time::ptime & | m_expired | ) |

Set the Expired object.

Parameters

  m_expired |

## ◆ SetIsSubKey()

void GpgFrontend::GenKeyInfo::SetIsSubKey | ( | bool | m_sub_key | ) |
| inline

Set the Is Sub Key object.

Parameters

  m_sub_key |

## ◆ SetKeyLength()

void GpgFrontend::GenKeyInfo::SetKeyLength | ( | int | m_key_size | ) |

Set the Key Size object.

Parameters

  m_key_size |

Referenced by SetAlgo().

## ◆ SetName()

void GpgFrontend::GenKeyInfo::SetName | ( | const std::string & | m_name | ) |
| inline

Set the Name object.

Parameters

  m_name |

## ◆ SetNonExpired()

void GpgFrontend::GenKeyInfo::SetNonExpired | ( | bool | m_non_expired | ) |

Set the Non Expired object.

Parameters

  m_non_expired |

## ◆ SetNonPassPhrase()

void GpgFrontend::GenKeyInfo::SetNonPassPhrase | ( | bool | m_non_pass_phrase | ) |
| inline

Set the Non Pass Phrase object.

Parameters

  m_non_pass_phrase |

## ◆ SetPassPhrase()

void GpgFrontend::GenKeyInfo::SetPassPhrase | ( | const std::string & | m_pass_phrase | ) |
| inline

Set the Pass Phrase object.

Parameters

  m_pass_phrase |

## Member Data Documentation

## ◆ expired_

boost::posix_time::ptime GpgFrontend::GenKeyInfo::expired_
| private

Initial value:
=
boost::posix_time::second_clock::local_time() +
boost::gregorian::years(2)

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

- src/core/GpgGenKeyInfo.h
- src/core/GpgGenKeyInfo.cpp