12 #ifndef ZYPP_PUBLICKEY_H 13 #define ZYPP_PUBLICKEY_H 21 #include <zypp/base/Iterable.h> 22 #include <zypp/base/PtrTypes.h> 23 #include <zypp/base/Exception.h> 25 #include <zypp/Pathname.h> 27 #include <zypp/Date.h> 31 struct _gpgme_key_sig;
88 explicit operator bool()
const;
92 std::string
id()
const;
145 explicit operator bool()
const;
149 std::string
id()
const;
152 std::string
name()
const;
215 explicit operator bool()
const;
219 std::string
id()
const;
222 std::string
name()
const;
297 bool providesKey(
const std::string & id_r )
const;
303 {
return id_r.size() >= 16; }
345 {
return !( lhs == rhs ); }
400 std::string
id()
const;
401 std::string
name()
const;
440 const std::list<PublicKeyData> &
hiddenKeys()
const;
451 bool operator==(
const std::string & sid )
const;
478 #endif // ZYPP_PUBLICKEY_H std::string asString() const
Simple string representation.
PublicKeySignatureData()
Default constructed: empty data.
bool hasSignatures() const
Whether signatures is not empty.
static bool isSafeKeyId(const std::string &id_r)
Whether this is a long id (64bit/16byte) or even better a fingerprint.
int daysToLive() const
Number of days (24h) until the key expires (or since it exired).
const std::list< PublicKeyData > & hiddenKeys() const
Additional keys data in case the ASCII armored blob contains multiple keys.
const PublicKeyData & keyData() const
The public keys data (.
Iterable< KeySignatureIterator > signatures() const
Iterate all key signatures.
bool operator!=(const std::string &sid) const
RWCOW_pointer< Impl > _pimpl
std::string gpgPubkeyRelease() const
Gpg-pubkey release as computed by rpm (hexencoded created)
virtual ~BadKeyException()
Dtor.
PublicSubkeyData implementation.
bool fileProvidesKey(const std::string &id_r) const
Extends providesKey to look at the hidden keys too.
Edition gpgPubkeyEdition() const
!<
Class representing one GPG Public Keys data.
bool expired() const
Whether the key has expired.
std::string asString() const
Simple string representation.
Exception thrown when the supplied key is not a valid gpg key.
std::string algoName() const
Key algorithm string like RSA 2048
PublicSubkeyData()
Default constructed: empty data.
Iterable< SubkeyIterator > subkeys() const
!<
std::string name() const
Key name.
String related utilities and Regular expression matching.
RWCOW_pointer< Impl > _pimpl
std::string asString() const
Simple string representation.
Date created() const
Creation date.
Edition represents [epoch:]version[-release]
bool hasSubkeys() const
!<
std::ostream & operator<<(std::ostream &str, const PublicKeySignatureData &obj)
bool operator==(const SetRelation::Enum &lhs, const SetCompare &rhs)
const PublicKeySignatureData * KeySignatureIterator
Provide a new empty temporary file and delete it when no longer needed.
Iterable< SubkeyIterator > subkeys() const
Iterate any subkeys.
Date expires() const
Expiry date, or Date() if the key never expires.
PublicKeyData()
Default constructed: empty data.
PublicKeySignatureData implementation.
bool inTrustedRing() const
Whether the signature is trusted in rpmdb.
AsciiArt asciiArt() const
!<
PublicKeyData::AsciiArt AsciiArt
std::ostream & operator<<(std::ostream &str, const PublicKeyData &obj)
std::string expiresAsString() const
std::string gpgPubkeyVersion() const
Gpg-pubkey version as computed by rpm (trailing 8 byte id)
std::string id() const
Subkey ID.
bool operator!=(const PublicKey &rhs) const
bool operator==(const PublicKey &rhs) const
std::string expiresAsString() const
int daysToLive() const
Number of days (24h) until the key expires (or since it exired).
RWCOW_pointer< Impl > _pimpl
Pointer to implementation.
std::string rpmName() const
Gpg-pubkey name as computed by rpm.
Store and operate on date (time_t).
Date created() const
Creation / last modification date (latest selfsig).
bool expired() const
Whether the key has expired.
base::DrunkenBishop AsciiArt
Random art fingerprint visualization type (base::DrunkenBishop).
std::string name() const
The user ID associated with this key, if present.
std::string gpgPubkeyVersion() const
std::string rpmName() const
const PublicSubkeyData * SubkeyIterator
bool providesKey(const std::string &id_r) const
!<
bool inKnownRing() const
Whether the key has been seen before.
BadKeyException()
Ctor taking message.
std::ostream & dumpOn(std::ostream &str, const Capability &obj)
friend std::ostream & dumpOn(std::ostream &str, const PublicKeyData &obj)
int daysToLive() const
Number of days (24h) until the key expires (or since it expired).
BadKeyException(const std::string &msg_r, const Pathname &keyfile=Pathname())
Ctor taking message.
std::ostream & operator<<(std::ostream &str, const PublicSubkeyData &obj)
Date created() const
Creation date.
PublicKey implementation.
std::string fingerprint() const
Key fingerprint.
bool expired() const
Whether the key has expired.
std::string gpgPubkeyRelease() const
Class representing a GPG Public Keys subkeys.
Class representing one GPG Public Key (PublicKeyData + ASCII armored in a tempfile).
std::ostream & operator<<(std::ostream &str, const PublicKey &obj)
Date expires() const
Expiry date, or Date() if the key never expires.
AsciiArt asciiArt() const
Random art fingerprint visualization (base::DrunkenBishop).
Base class for Exception.
static bool isSafeKeyId(const std::string &id_r)
!<
Pathname path() const
File containing the ASCII armored key.
std::string id() const
Key ID.
Edition gpgPubkeyEdition() const
Gpg-pubkey Edition built from version and release.
RWCOW_pointer< Impl > _pimpl
std::string fingerprint() const
std::string asString() const
PublicKeyData implementation.
friend std::ostream & dumpOn(std::ostream &str, const PublicKeyData &obj)
static PublicKey noThrow(const Pathname &keyFile_r)
Static ctor returning an empty PublicKey rather than throwing.
bool operator!=(const PublicKeyData &lhs, const PublicKeyData &rhs)
friend std::ostream & dumpOn(std::ostream &str, const PublicKeyData &obj)
static PublicKeyData fromGpgmeKey(_gpgme_key *data)
Easy-to use interface to the ZYPP dependency resolver.
bool providesKey(const std::string &id_r) const
Whether id_r is the id or fingerprint of the primary key or of a subkey.
Class representing a signature on a GPG Public Key.
Date expires() const
Expiry date, or Date() if the key never expires.
std::string algoName() const
std::string id() const
The key ID of key used to create the signature.
bool hasSubkeys() const
Whether subkeys is not empty.
Random art fingerprint visualization Visualize fingerprint data on a [17x9] (SSH) or [19x11] (GPG) or...
~PublicKeySignatureData()
PublicKeyData::SubkeyIterator SubkeyIterator