libzypp 17.35.1
|
Class representing one GPG Public Keys data. More...
#include <zypp/PublicKey.h>
Classes | |
class | Impl |
PublicKeyData implementation. More... | |
Public Types | |
using | SubkeyIterator = const PublicSubkeyData * |
using | KeySignatureIterator = const PublicKeySignatureData * |
using | AsciiArt = base::DrunkenBishop |
Random art fingerprint visualization type (base::DrunkenBishop). | |
Public Member Functions | |
PublicKeyData () | |
Default constructed: empty data. | |
~PublicKeyData () | |
PublicKeyData (const PublicKeyData &)=default | |
PublicKeyData (PublicKeyData &&) noexcept=default | |
PublicKeyData & | operator= (const PublicKeyData &)=default |
PublicKeyData & | operator= (PublicKeyData &&) noexcept=default |
operator bool () const | |
Whether this contains valid data (not default constructed). | |
std::string | id () const |
Key ID. | |
std::string | name () const |
Key name. | |
std::string | fingerprint () const |
Key fingerprint. | |
std::string | algoName () const |
Key algorithm string like RSA 2048 | |
Date | created () const |
Creation / last modification date (latest selfsig). | |
Date | expires () const |
Expiry date, or Date() if the key never expires. | |
bool | expired () const |
Whether the key has expired. | |
int | daysToLive () const |
Number of days (24h) until the key expires (or since it exired). | |
std::string | expiresAsString () const |
std::string | gpgPubkeyVersion () const |
Gpg-pubkey version as computed by rpm (trailing 8 byte id) | |
std::string | gpgPubkeyRelease () const |
Gpg-pubkey release as computed by rpm (hexencoded created) | |
std::string | rpmName () const |
Gpg-pubkey name as computed by rpm. | |
Edition | gpgPubkeyEdition () const |
Gpg-pubkey Edition built from version and release. | |
std::string | asString () const |
Simple string representation. | |
bool | hasSubkeys () const |
Whether subkeys is not empty. | |
Iterable< SubkeyIterator > | subkeys () const |
Iterate any subkeys. | |
Iterable< KeySignatureIterator > | signatures () const |
Iterate all key signatures. | |
bool | providesKey (const std::string &id_r) const |
Whether id_r is the id or fingerprint of the primary key or of a subkey. | |
bool | hasSignatures () const |
Whether signatures is not empty. | |
AsciiArt | asciiArt () const |
Random art fingerprint visualization (base::DrunkenBishop). | |
Static Public Member Functions | |
static bool | isSafeKeyId (const std::string &id_r) |
Whether this is a long id (64bit/16byte) or even better a fingerprint. | |
Private Member Functions | |
PublicKeyData (shared_ptr< Impl > data) | |
Static Private Member Functions | |
static PublicKeyData | fromGpgmeKey (_gpgme_key *data) |
Private Attributes | |
RWCOW_pointer< Impl > | _pimpl |
Friends | |
class | KeyManagerCtx |
std::ostream & | dumpOn (std::ostream &str, const PublicKeyData &obj) |
Related Symbols | |
(Note that these are not member symbols.) | |
std::ostream & | operator<< (std::ostream &str, const PublicKeyData &obj) |
Stream output. | |
std::ostream & | dumpOn (std::ostream &str, const PublicKeyData &obj) ZYPP_API |
Detailed stream output. | |
bool | operator== (const PublicKeyData &lhs, const PublicKeyData &rhs) ZYPP_API |
Equal based on fingerprint anf creation date. | |
bool | operator!= (const PublicKeyData &lhs, const PublicKeyData &rhs) |
NotEqual. | |
Class representing one GPG Public Keys data.
PublicKeyData are provided e.g. by a PublicKey or a KeyRing. PublicKeyData are usually easier to retrieve and sufficient unless you actually need an ASCII armored version of the key placed in a tempfile. In this case use PublicKey.
Definition at line 207 of file PublicKey.h.
Definition at line 288 of file PublicKey.h.
Definition at line 289 of file PublicKey.h.
Random art fingerprint visualization type (base::DrunkenBishop).
Definition at line 317 of file PublicKey.h.
zypp::PublicKeyData::PublicKeyData | ( | ) |
zypp::PublicKeyData::~PublicKeyData | ( | ) |
Definition at line 409 of file PublicKey.cc.
|
default |
|
defaultnoexcept |
|
private |
Definition at line 405 of file PublicKey.cc.
|
default |
|
defaultnoexcept |
|
explicit |
Whether this contains valid data (not default constructed).
Definition at line 415 of file PublicKey.cc.
std::string zypp::PublicKeyData::id | ( | ) | const |
Key ID.
Definition at line 418 of file PublicKey.cc.
std::string zypp::PublicKeyData::name | ( | ) | const |
std::string zypp::PublicKeyData::fingerprint | ( | ) | const |
Key fingerprint.
Definition at line 424 of file PublicKey.cc.
std::string zypp::PublicKeyData::algoName | ( | ) | const |
Key algorithm string like RSA 2048
Definition at line 427 of file PublicKey.cc.
Date zypp::PublicKeyData::created | ( | ) | const |
Creation / last modification date (latest selfsig).
Definition at line 430 of file PublicKey.cc.
Date zypp::PublicKeyData::expires | ( | ) | const |
Expiry date, or Date()
if the key never expires.
Definition at line 433 of file PublicKey.cc.
bool zypp::PublicKeyData::expired | ( | ) | const |
Whether the key has expired.
Definition at line 436 of file PublicKey.cc.
int zypp::PublicKeyData::daysToLive | ( | ) | const |
Number of days (24h) until the key expires (or since it exired).
A value of 0
means the key will expire within the next 24h. Negative values indicate the key has expired less than N
days ago. For keys without expiration date INT_MAX
is returned.
Definition at line 439 of file PublicKey.cc.
std::string zypp::PublicKeyData::expiresAsString | ( | ) | const |
Definition at line 442 of file PublicKey.cc.
std::string zypp::PublicKeyData::gpgPubkeyVersion | ( | ) | const |
Gpg-pubkey version as computed by rpm (trailing 8 byte id)
Definition at line 445 of file PublicKey.cc.
std::string zypp::PublicKeyData::gpgPubkeyRelease | ( | ) | const |
Gpg-pubkey release as computed by rpm (hexencoded created)
Definition at line 448 of file PublicKey.cc.
std::string zypp::PublicKeyData::rpmName | ( | ) | const |
Gpg-pubkey name as computed by rpm.
Definition at line 451 of file PublicKey.cc.
|
inline |
Gpg-pubkey Edition built from version and release.
Definition at line 276 of file PublicKey.h.
std::string zypp::PublicKeyData::asString | ( | ) | const |
Simple string representation.
Encodes id, gpgPubkeyRelease, name and fingerprint.
Definition at line 454 of file PublicKey.cc.
bool zypp::PublicKeyData::hasSubkeys | ( | ) | const |
Whether subkeys is not empty.
Definition at line 466 of file PublicKey.cc.
Iterable< PublicKeyData::SubkeyIterator > zypp::PublicKeyData::subkeys | ( | ) | const |
Iterate any subkeys.
Definition at line 469 of file PublicKey.cc.
Iterable< PublicKeyData::KeySignatureIterator > zypp::PublicKeyData::signatures | ( | ) | const |
Iterate all key signatures.
Definition at line 472 of file PublicKey.cc.
bool zypp::PublicKeyData::providesKey | ( | const std::string & | id_r | ) | const |
Whether id_r is the id or fingerprint of the primary key or of a subkey.
As a convenience also allows to test the 8byte short ID e.g. rpm uses as version.
Definition at line 475 of file PublicKey.cc.
Whether this is a long id (64bit/16byte) or even better a fingerprint.
A short Id (32bit/8byte) is not considered to be a safe identifier for a key.
Definition at line 308 of file PublicKey.h.
bool zypp::PublicKeyData::hasSignatures | ( | ) | const |
Whether signatures is not empty.
PublicKeyData::AsciiArt zypp::PublicKeyData::asciiArt | ( | ) | const |
Random art fingerprint visualization (base::DrunkenBishop).
Definition at line 486 of file PublicKey.cc.
|
staticprivate |
Definition at line 412 of file PublicKey.cc.
|
friend |
Definition at line 331 of file PublicKey.h.
|
friend |
Definition at line 489 of file PublicKey.cc.
|
related |
Stream output.
Definition at line 340 of file PublicKey.h.
|
related |
Detailed stream output.
Definition at line 489 of file PublicKey.cc.
|
related |
Equal based on fingerprint anf creation date.
Definition at line 504 of file PublicKey.cc.
|
related |
NotEqual.
Definition at line 350 of file PublicKey.h.
|
private |
Definition at line 329 of file PublicKey.h.