#include <PublicKey.h>
Classes | |
class | Impl |
PublicKey implementation. More... | |
Public Member Functions | |
PublicKey () | |
Default ctor. | |
PublicKey (const Pathname &file) | |
Ctor taking the key from a file. | |
PublicKey (const filesystem::TmpFile &sharedfile) | |
Ctor reading the key from a TmpFile. | |
~PublicKey () | |
bool | isValid () const |
std::string | asString () const |
std::string | armoredData () const |
std::string | id () const |
std::string | name () const |
std::string | fingerprint () const |
std::string | gpgPubkeyVersion () const |
Version rpm would assign to this key if imported into the rpm database. | |
std::string | gpgPubkeyRelease () const |
Release rpm would assign to this key if imported into the rpm database. | |
Date | created () const |
Date when the key was created. | |
Date | expires () const |
Date when the key expires. | |
std::string | expiresAsString () const |
Expiry info in a human readable form. | |
bool | expired () const |
Whether the key has expired. | |
int | daysToLive () const |
Number of days (24h) until the key expires (or since it exired). | |
Pathname | path () const |
bool | operator== (PublicKey b) const |
bool | operator== (std::string sid) const |
Private Attributes | |
RWCOW_pointer< Impl > | _pimpl |
Pointer to implementation. | |
Friends | |
std::ostream & | operator<< (std::ostream &str, const PublicKey &obj) |
Related Functions | |
(Note that these are not member functions.) | |
std::ostream & | dumpOn (std::ostream &str, const PublicKey &obj) |
If a key file actually contains multiple keys, the last one is taken.
Definition at line 72 of file PublicKey.h.
zypp::PublicKey::PublicKey | ( | ) |
zypp::PublicKey::PublicKey | ( | const Pathname & | file | ) | [explicit] |
Ctor taking the key from a file.
This is quite expensive, as a copy of the file is created and used. If you can construct PublicKey from a filesystem::TmpFile, this prevents copying.
when | data does not make a key |
Definition at line 308 of file PublicKey.cc.
zypp::PublicKey::PublicKey | ( | const filesystem::TmpFile & | sharedfile | ) | [explicit] |
Ctor reading the key from a TmpFile.
PublicKey holds a reference on the TmpFile providing the key.
when | data does not make a key |
Definition at line 312 of file PublicKey.cc.
zypp::PublicKey::~PublicKey | ( | ) |
Definition at line 316 of file PublicKey.cc.
bool zypp::PublicKey::isValid | ( | ) | const [inline] |
std::string zypp::PublicKey::asString | ( | ) | const |
Definition at line 319 of file PublicKey.cc.
References _pimpl.
Referenced by zypp::target::rpm::RpmDb::importPubkey(), and zypp::target::rpm::RpmDb::removePubkey().
std::string zypp::PublicKey::armoredData | ( | ) | const |
std::string zypp::PublicKey::id | ( | ) | const |
Definition at line 325 of file PublicKey.cc.
References _pimpl.
Referenced by zypp::dumpOn(), zypp::target::rpm::RpmDb::importPubkey(), operator==(), zypp::KeyRing::Impl::publicKeys(), zypp::target::rpm::RpmDb::removePubkey(), zypp::target::rpm::KeyRingSignalReceiver::trustedKeyAdded(), and zypp::target::rpm::KeyRingSignalReceiver::trustedKeyRemoved().
std::string zypp::PublicKey::name | ( | ) | const |
Definition at line 328 of file PublicKey.cc.
References _pimpl.
Referenced by zypp::dumpOn(), zypp::KeyRing::Impl::publicKeys(), zypp::target::rpm::KeyRingSignalReceiver::trustedKeyAdded(), zypp::target::rpm::KeyRingSignalReceiver::trustedKeyRemoved(), and zypp::KeyRing::Impl::verifyFileSignatureWorkflow().
std::string zypp::PublicKey::fingerprint | ( | ) | const |
Definition at line 331 of file PublicKey.cc.
References _pimpl.
Referenced by zypp::dumpOn(), isValid(), operator==(), zypp::KeyRing::Impl::publicKeys(), and zypp::KeyRing::Impl::verifyFileSignatureWorkflow().
std::string zypp::PublicKey::gpgPubkeyVersion | ( | ) | const |
Version rpm would assign to this key if imported into the rpm database.
Rpm uses the lowercased trailing 8 byte from id as version
, and the creations dates lowercased hexadecimal representation as release
.
[zypp OBS Project <zypp@build.opensuse.org>] fpr 47D7CE1DD600935B3B90365733D38EBC7FB7F464 id 33D38EBC7FB7F464 <-- trailing 8 byte cre Thu Mar 13 19:15:40 2008 <-- converted to hex exp Sat May 22 20:15:40 2010 ] Converting the creation date to its hexadecimal representation: $ bc <<<"obase=16;$(date -d 'Thu Mar 13 19:15:40 2008' +%s)" 47D96F4C Rpms name for this key: gpg-pubkey-7fb7f464-47d96f4c
Definition at line 334 of file PublicKey.cc.
References _pimpl.
Referenced by zypp::dumpOn().
std::string zypp::PublicKey::gpgPubkeyRelease | ( | ) | const |
Release rpm would assign to this key if imported into the rpm database.
This is the creations dates hexadecimal representation as release
lowercased.
Definition at line 337 of file PublicKey.cc.
References _pimpl.
Referenced by zypp::dumpOn().
Date zypp::PublicKey::created | ( | ) | const |
Date when the key was created.
Definition at line 340 of file PublicKey.cc.
References _pimpl.
Referenced by zypp::dumpOn(), zypp::target::rpm::RpmDb::importPubkey(), operator==(), and zypp::KeyRing::Impl::verifyFileSignatureWorkflow().
Date zypp::PublicKey::expires | ( | ) | const |
Date when the key expires.
If the key never expires the date is Date() (i.e. 0 seconds since the epoch (1.1.1970))
Definition at line 343 of file PublicKey.cc.
References _pimpl.
std::string zypp::PublicKey::expiresAsString | ( | ) | const |
Expiry info in a human readable form.
The exipry daye plus an annotation if the key has expired, or will expire within 90 days.
(does not expire) Tue May 11 13:37:33 CEST 2010 Tue May 11 13:37:33 CEST 2010 (expires in 90 days) Tue May 11 13:37:33 CEST 2010 (expires in 1 day) Tue May 11 13:37:33 CEST 2010 (expires within 24h) Tue May 11 13:37:33 CEST 2010 (EXPIRED)
Definition at line 346 of file PublicKey.cc.
References _pimpl.
Referenced by zypp::dumpOn().
bool zypp::PublicKey::expired | ( | ) | const |
int zypp::PublicKey::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 352 of file PublicKey.cc.
References _pimpl.
Referenced by zypp::dumpOn().
Pathname zypp::PublicKey::path | ( | ) | const |
Definition at line 355 of file PublicKey.cc.
References _pimpl.
Referenced by zypp::KeyRing::Impl::importKey(), zypp::target::rpm::RpmDb::importPubkey(), isValid(), zypp::target::rpm::KeyRingSignalReceiver::trustedKeyAdded(), and zypp::KeyRing::Impl::verifyFileSignatureWorkflow().
bool zypp::PublicKey::operator== | ( | PublicKey | b | ) | const |
bool zypp::PublicKey::operator== | ( | std::string | sid | ) | const |
std::ostream & operator<< | ( | std::ostream & | str, | |
const PublicKey & | obj | |||
) | [friend] |
Stream output
Definition at line 190 of file PublicKey.h.
std::ostream & dumpOn | ( | std::ostream & | str, | |
const PublicKey & | obj | |||
) | [related] |
Detailed stream output
Definition at line 370 of file PublicKey.cc.
RWCOW_pointer<Impl> zypp::PublicKey::_pimpl [private] |
Pointer to implementation.
Definition at line 185 of file PublicKey.h.
Referenced by asString(), created(), daysToLive(), expired(), expires(), expiresAsString(), fingerprint(), gpgPubkeyRelease(), gpgPubkeyVersion(), id(), name(), and path().