12#ifndef ZYPP_PUBLICKEY_H
13#define ZYPP_PUBLICKEY_H
89 explicit operator bool()
const;
93 std::string
id()
const;
146 explicit operator bool()
const;
150 std::string
id()
const;
153 std::string
name()
const;
221 explicit operator
bool() const;
225 std::
string id() const;
303 bool providesKey(
const std::string & id_r )
const;
309 {
return id_r.size() >= 16; }
351 {
return !( lhs == rhs ); }
406 std::string id()
const;
407 std::string name()
const;
408 std::string fingerprint()
const;
409 std::string algoName()
const;
410 Date created()
const;
411 Date expires()
const;
412 std::string expiresAsString()
const;
413 bool expired()
const;
414 int daysToLive()
const;
415 std::string gpgPubkeyVersion()
const;
416 std::string gpgPubkeyRelease()
const;
418 std::string rpmName ()
const;
421 {
return keyData().gpgPubkeyEdition(); }
424 {
return keyData().hasSubkeys(); }
427 {
return keyData().subkeys(); }
430 {
return keyData().providesKey( id_r ); }
439 {
return keyData().asciiArt(); }
446 const std::list<PublicKeyData> & hiddenKeys()
const;
451 bool fileProvidesKey(
const std::string & id_r )
const;
457 bool operator==(
const std::string & sid )
const;
BadKeyException(const std::string &msg_r, Pathname keyfile=Pathname())
Ctor taking message.
~BadKeyException() override
Dtor.
BadKeyException()
Ctor taking message.
Store and operate on date (time_t).
Edition represents [epoch:]version[-release]
Class representing one GPG Public Keys data.
Iterable< KeySignatureIterator > signatures() const
Iterate all key signatures.
Date created() const
Creation / last modification date (latest selfsig).
bool expired() const
Whether the key has expired.
std::string name() const
Key name.
bool hasSignatures() const
Whether signatures is not empty.
Iterable< SubkeyIterator > subkeys() const
Iterate any subkeys.
int daysToLive() const
Number of days (24h) until the key expires (or since it exired).
friend class KeyManagerCtx
bool operator!=(const PublicKeyData &lhs, const PublicKeyData &rhs)
NotEqual.
std::string rpmName() const
Gpg-pubkey name as computed by rpm.
bool hasSubkeys() const
Whether subkeys is not empty.
PublicKeyData()
Default constructed: empty data.
const PublicSubkeyData * SubkeyIterator
Date expires() const
Expiry date, or Date() if the key never expires.
std::string algoName() const
Key algorithm string like RSA 2048
PublicKeyData(const PublicKeyData &)=default
static bool isSafeKeyId(const std::string &id_r)
Whether this is a long id (64bit/16byte) or even better a fingerprint.
RWCOW_pointer< Impl > _pimpl
bool providesKey(const std::string &id_r) const
Whether id_r is the id or fingerprint of the primary key or of a subkey.
std::string fingerprint() const
Key fingerprint.
std::string gpgPubkeyRelease() const
Gpg-pubkey release as computed by rpm (hexencoded created)
std::string gpgPubkeyVersion() const
Gpg-pubkey version as computed by rpm (trailing 8 byte id)
PublicKeyData(PublicKeyData &&) noexcept=default
static PublicKeyData fromGpgmeKey(_gpgme_key *data)
std::string expiresAsString() const
AsciiArt asciiArt() const
Random art fingerprint visualization (base::DrunkenBishop).
std::string asString() const
Simple string representation.
base::DrunkenBishop AsciiArt
Random art fingerprint visualization type (base::DrunkenBishop).
Edition gpgPubkeyEdition() const
Gpg-pubkey Edition built from version and release.
std::ostream & operator<<(std::ostream &str, const PublicKeyData &obj)
Stream output.
const PublicKeySignatureData * KeySignatureIterator
Class representing a signature on a GPG Public Key.
Date created() const
Creation date.
std::string asString() const
Simple string representation.
bool inKnownRing() const
Whether the key has been seen before.
PublicKeySignatureData()
Default constructed: empty data.
RWCOW_pointer< Impl > _pimpl
bool inTrustedRing() const
Whether the signature is trusted in rpmdb.
int daysToLive() const
Number of days (24h) until the key expires (or since it expired).
bool expired() const
Whether the key has expired.
std::string id() const
The key ID of key used to create the signature.
std::ostream & operator<<(std::ostream &str, const PublicKeySignatureData &obj)
Stream output.
std::string name() const
The user ID associated with this key, if present.
Date expires() const
Expiry date, or Date() if the key never expires.
friend class PublicKeyData
Class representing one GPG Public Key (PublicKeyData + ASCII armored in a tempfile).
Edition gpgPubkeyEdition() const
!<
PublicKeyData::AsciiArt AsciiArt
AsciiArt asciiArt() const
!<
RWCOW_pointer< Impl > _pimpl
Pointer to implementation.
static bool isSafeKeyId(const std::string &id_r)
!<
const PublicKeyData & keyData() const
The public keys data (.
std::string asString() const
std::string fingerprint() const
std::ostream & operator<<(std::ostream &str, const PublicKey &obj)
Stream output.
bool operator!=(const std::string &sid) const
bool operator!=(const PublicKey &rhs) const
PublicKeyData::SubkeyIterator SubkeyIterator
static PublicKey noThrow(const Pathname &keyFile_r)
Static ctor returning an empty PublicKey rather than throwing.
bool hasSubkeys() const
!<
bool providesKey(const std::string &id_r) const
!<
Iterable< SubkeyIterator > subkeys() const
!<
Class representing a GPG Public Keys subkeys.
RWCOW_pointer< Impl > _pimpl
std::string id() const
Subkey ID.
PublicSubkeyData()
Default constructed: empty data.
std::ostream & operator<<(std::ostream &str, const PublicSubkeyData &obj)
Stream output.
int daysToLive() const
Number of days (24h) until the key expires (or since it exired).
Date expires() const
Expiry date, or Date() if the key never expires.
friend class PublicKeyData
std::string asString() const
Simple string representation.
Date created() const
Creation date.
bool expired() const
Whether the key has expired.
Random art fingerprint visualization Visualize fingerprint data on a [17x9] (SSH) or [19x11] (GPG) or...
Provide a new empty temporary file and delete it when no longer needed.
String related utilities and Regular expression matching.
Types and functions for filesystem operations.
Easy-to use interface to the ZYPP dependency resolver.
bool operator==(const SetRelation::Enum &lhs, const SetCompare &rhs)
This is an overloaded member function, provided for convenience. It differs from the above function o...
std::ostream & dumpOn(std::ostream &str, const Capability &obj)
const Arch Arch_armv7hnl Arch_armv7nhl ZYPP_API
std::string asString(const Patch::Category &obj)
PublicKeyData implementation.
PublicKeySignatureData implementation.
PublicKey implementation.
PublicSubkeyData implementation.
RW_pointer supporting 'copy on write' functionality.