GpgFrontend::GpgKey Class Reference
Collaboration diagram for GpgFrontend::GpgKey:

## Classes

struct | _key_ref_deleter

## Public Member Functions

bool | IsGood () const
std::string | GetId () const
std::string | GetName () const
std::string | GetEmail () const
std::string | GetComment () const
std::string | GetFingerprint () const
std::string | GetProtocol () const
std::string | GetOwnerTrust () const
std::string | GetPublicKeyAlgo () const
boost::posix_time::ptime | GetLastUpdateTime () const
boost::posix_time::ptime | GetExpireTime () const
boost::posix_time::ptime | GetCreateTime () const
| Create a time object. More...
unsigned int | GetPrimaryKeyLength () const
| s More...
bool | IsHasEncryptionCapability () const
bool | IsHasActualEncryptionCapability () const
bool | IsHasSigningCapability () const
bool | IsHasActualSigningCapability () const
bool | IsHasCertificationCapability () const
bool | IsHasActualCertificationCapability () const
bool | IsHasAuthenticationCapability () const
bool | IsHasActualAuthenticationCapability () const
bool | IsHasCardKey () const
bool | IsPrivateKey () const
bool | IsExpired () const
bool | IsRevoked () const
bool | IsDisabled () const
bool | IsHasMasterKey () const
std::unique_ptr< std::vector< GpgSubKey > > | GetSubKeys () const
std::unique_ptr< std::vector< GpgUID > > | GetUIDs () const
| GpgKey ()=default
| Construct a new Gpg Key object. More...
| GpgKey (gpgme_key_t &&key)
| Construct a new Gpg Key object. More...
| ~GpgKey ()=default
| Destroy the Gpg Key objects. More...
| GpgKey (const gpgme_key_t &key)=delete
| Construct a new Gpg Key object. More...
| GpgKey (GpgKey &&k) noexcept
| Construct a new Gpg Key object. More...
GpgKey & | operator= (GpgKey &&k) noexcept
GpgKey & | operator= (const gpgme_key_t &key)=delete
bool | operator== (const GpgKey &o) const
bool | operator<= (const GpgKey &o) const
| operator gpgme_key_t () const
GpgKey | Copy () const

## Private Types

using | KeyRefHandler = std::unique_ptr< struct _gpgme_key, _key_ref_deleter >

## Private Attributes

KeyRefHandler | key_ref_ = nullptr

## Constructor & Destructor Documentation

## GpgKey() [1/4]

GpgFrontend::GpgKey::GpgKey | ( |  | ) |

default

Construct a new Gpg Key object.

## GpgKey() [2/4]

GpgFrontend::GpgKey::GpgKey | ( | gpgme_key_t && | key | ) |

explicit

Construct a new Gpg Key object.

Parameters

  key | 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

## ~GpgKey()

GpgFrontend::GpgKey::~GpgKey | ( |  | ) |

default

Destroy the Gpg Key objects.

## GpgKey() [3/4]

GpgFrontend::GpgKey::GpgKey | ( | const gpgme_key_t & | key | ) |

delete

Construct a new Gpg Key object.

Parameters

  key |

## GpgKey() [4/4]

GpgFrontend::GpgKey::GpgKey | ( | GpgKey && | k | ) |

noexcept

Construct a new Gpg Key object.

Parameters

  k |

## Member Function Documentation

## Copy()

GpgFrontend::GpgKey GpgFrontend::GpgKey::Copy | ( |  | ) | const

Returns
  GpgKey

## GetComment()

std::string GpgFrontend::GpgKey::GetComment | ( |  | ) | const

Returns
  std::string

## GetCreateTime()

boost::posix_time::ptime GpgFrontend::GpgKey::GetCreateTime | ( |  | ) | const

Create a time object.

Returns
  boost::posix_time::ptime

## GetEmail()

std::string GpgFrontend::GpgKey::GetEmail | ( |  | ) | const

Returns
  std::string

Referenced by GpgFrontend::UI::VerifyKeyDetailBox::create_key_info_grid(), GpgFrontend::UI::KeyImportDetailDialog::create_keys_table(), GpgFrontend::UI::KeyPairDetailTab::KeyPairDetailTab(), GpgFrontend::UI::KeyPairSubkeyTab::KeyPairSubkeyTab(), and GpgFrontend::UI::KeyPairOperaTab::slot_export_private_key().

## GetExpireTime()

boost::posix_time::ptime GpgFrontend::GpgKey::GetExpireTime | ( |  | ) | const

Returns
  boost::posix_time::ptime

## GetFingerprint()

std::string GpgFrontend::GpgKey::GetFingerprint | ( |  | ) | const

Returns
  std::string

Referenced by GpgFrontend::GpgKeyOpera::GenerateRevokeCert(), and GpgFrontend::GpgKeyOpera::SetExpire().

## GetId()

std::string GpgFrontend::GpgKey::GetId | ( |  | ) | const

Returns
  std::string

Referenced by GpgFrontend::GpgKeyImportExporter::ExportKey(), GpgFrontend::GpgKeyImportExporter::ExportKeyOpenSSH(), GpgFrontend::GpgKeyImportExporter::ExportSecretKey(), GpgFrontend::GpgKeyImportExporter::ExportSecretKeyShortest(), GpgFrontend::GpgKeyOpera::GenerateSubkey(), GpgFrontend::UI::KeyUIDSignDialog::KeyUIDSignDialog(), operator<=(), operator==(), GpgFrontend::GpgKeyOpera::SetExpire(), and GpgFrontend::UI::KeyPairOperaTab::slot_export_private_key().

## GetLastUpdateTime()

boost::posix_time::ptime GpgFrontend::GpgKey::GetLastUpdateTime | ( |  | ) | const

Returns
  boost::posix_time::ptime

## GetName()

std::string GpgFrontend::GpgKey::GetName | ( |  | ) | const

Returns
  std::string

Referenced by GpgFrontend::UI::VerifyKeyDetailBox::create_key_info_grid(), GpgFrontend::UI::KeyImportDetailDialog::create_keys_table(), GpgFrontend::GpgDecryptResultAnalyse::print_recipient(), and GpgFrontend::UI::KeyPairOperaTab::slot_export_private_key().

## GetOwnerTrust()

std::string GpgFrontend::GpgKey::GetOwnerTrust | ( |  | ) | const

Returns
  std::string

## GetPrimaryKeyLength()

unsigned int GpgFrontend::GpgKey::GetPrimaryKeyLength | ( |  | ) | const

s

Returns
  unsigned int

## GetProtocol()

std::string GpgFrontend::GpgKey::GetProtocol | ( |  | ) | const

Returns
  std::string

## GetPublicKeyAlgo()

std::string GpgFrontend::GpgKey::GetPublicKeyAlgo | ( |  | ) | const

Returns
  std::string

## GetSubKeys()

std::unique_ptr< std::vector< GpgFrontend::GpgSubKey > > GpgFrontend::GpgKey::GetSubKeys | ( |  | ) | const

Returns
  std::unique_ptr<std::vector<GpgSubKey>>

Referenced by GpgFrontend::UI::KeyPairDetailTab::KeyPairDetailTab(), and GpgFrontend::UI::KeyPairSubkeyTab::KeyPairSubkeyTab().

## GetUIDs()

std::unique_ptr< std::vector< GpgFrontend::GpgUID > > GpgFrontend::GpgKey::GetUIDs | ( |  | ) | const

Returns
  std::unique_ptr<std::vector<GpgUID>>

## IsDisabled()

bool GpgFrontend::GpgKey::IsDisabled | ( |  | ) | const

Returns
  true
  false

Referenced by GpgFrontend::UI::MainWindow::create_dock_windows(), GpgFrontend::UI::KeyMgmt::KeyMgmt(), and GpgFrontend::UI::KeyUIDSignDialog::KeyUIDSignDialog().

## IsExpired()

bool GpgFrontend::GpgKey::IsExpired | ( |  | ) | const

Returns
  true
  false

Referenced by GpgFrontend::UI::MainWindow::create_dock_windows(), GpgFrontend::UI::KeyMgmt::KeyMgmt(), and GpgFrontend::UI::KeyUIDSignDialog::KeyUIDSignDialog().

## IsGood()

bool GpgFrontend::GpgKey::IsGood | ( |  | ) | const

Returns
  true
  false

Referenced by GpgFrontend::UI::VerifyKeyDetailBox::create_key_info_grid(), and GpgFrontend::UI::KeyImportDetailDialog::create_keys_table().

## IsHasActualAuthenticationCapability()

bool GpgFrontend::GpgKey::IsHasActualAuthenticationCapability | ( |  | ) | const

Returns
  true
  false

## IsHasActualCertificationCapability()

bool GpgFrontend::GpgKey::IsHasActualCertificationCapability | ( |  | ) | const

Returns
  true
  false

check if key can certify(actually)

Parameters

  key | target key

Returns
  if key certify

## IsHasActualEncryptionCapability()

bool GpgFrontend::GpgKey::IsHasActualEncryptionCapability | ( |  | ) | const

Returns
  true
  false

check if key can encrypt(actually)

Parameters

  key | target key

Returns
  if key encrypt

## IsHasActualSigningCapability()

bool GpgFrontend::GpgKey::IsHasActualSigningCapability | ( |  | ) | const

Returns
  true
  false

Referenced by GpgFrontend::UI::SignersPicker::SignersPicker().

## IsHasAuthenticationCapability()

bool GpgFrontend::GpgKey::IsHasAuthenticationCapability | ( |  | ) | const

Returns
  true
  false

## IsHasCardKey()

bool GpgFrontend::GpgKey::IsHasCardKey | ( |  | ) | const

Returns
  true
  false

## IsHasCertificationCapability()

bool GpgFrontend::GpgKey::IsHasCertificationCapability | ( |  | ) | const

Returns
  true
  false

Referenced by GpgFrontend::UI::KeyUIDSignDialog::KeyUIDSignDialog().

## IsHasEncryptionCapability()

bool GpgFrontend::GpgKey::IsHasEncryptionCapability | ( |  | ) | const

Returns
  true
  false

## IsHasMasterKey()

bool GpgFrontend::GpgKey::IsHasMasterKey | ( |  | ) | const

Returns
  true
  false

Referenced by GpgFrontend::UI::KeyPairUIDTab::create_manage_uid_menu(), GpgFrontend::UI::KeyPairUIDTab::create_uid_popup_menu(), GpgFrontend::UI::KeyPairOperaTab::CreateOperaMenu(), GpgFrontend::UI::KeyMgmt::KeyMgmt(), GpgFrontend::UI::KeyPairDetailTab::KeyPairDetailTab(), GpgFrontend::UI::KeyPairOperaTab::KeyPairOperaTab(), GpgFrontend::UI::KeyPairSubkeyTab::KeyPairSubkeyTab(), GpgFrontend::UI::KeyPairUIDTab::KeyPairUIDTab(), and GpgFrontend::UI::KeyUIDSignDialog::KeyUIDSignDialog().

## IsHasSigningCapability()

bool GpgFrontend::GpgKey::IsHasSigningCapability | ( |  | ) | const

Returns
  true
  false

## IsPrivateKey()

bool GpgFrontend::GpgKey::IsPrivateKey | ( |  | ) | const

Returns
  true
  false

Referenced by GpgFrontend::UI::MainWindow::create_dock_windows(), GpgFrontend::UI::KeyPairOperaTab::CreateOperaMenu(), GpgFrontend::UI::KeyMgmt::KeyMgmt(), GpgFrontend::UI::KeyPairDetailTab::KeyPairDetailTab(), GpgFrontend::UI::KeyPairOperaTab::KeyPairOperaTab(), and GpgFrontend::UI::KeyPairSubkeyTab::KeyPairSubkeyTab().

## IsRevoked()

bool GpgFrontend::GpgKey::IsRevoked | ( |  | ) | const

Returns
  true
  false

Referenced by GpgFrontend::UI::MainWindow::create_dock_windows(), GpgFrontend::UI::KeyMgmt::KeyMgmt(), and GpgFrontend::UI::KeyUIDSignDialog::KeyUIDSignDialog().

## operator gpgme_key_t()

GpgFrontend::GpgKey::operator gpgme_key_t | ( |  | ) | const

explicit

Returns
  gpgme_key_t

## operator<=()

bool GpgFrontend::GpgKey::operator<= | ( | const GpgKey & | o | ) | const

Parameters

  o |

Returns
  true
  false

References GetId().

## operator=() [1/2]

GpgKey& GpgFrontend::GpgKey::operator= | ( | const gpgme_key_t & | key | ) |

delete

Parameters

  key |

Returns
  GpgKey&

## operator=() [2/2]

GpgFrontend::GpgKey & GpgFrontend::GpgKey::operator= | ( | GpgKey && | k | ) |

noexcept

Parameters

  k |

Returns
  GpgKey&

## operator==()

bool GpgFrontend::GpgKey::operator== | ( | const GpgKey & | o | ) | const

Parameters

  o |

Returns
  true
  false

References GetId().

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

- src/core/model/GpgKey.h
- src/core/model/GpgKey.cpp