libzypp
10.5.0
|
Class that represent a GPG Public Key. More...
#include <PublicKey.h>
Classes | |
struct | 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 | 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 & | operator<< (std::ostream &str, const PublicKey &obj) |
std::ostream & | dumpOn (std::ostream &str, const PublicKey &obj) |
Class that represent a GPG Public Key.
Definition at line 76 of file PublicKey.h.
zypp::PublicKey::PublicKey | ( | ) |
Default ctor.
Definition at line 272 of file PublicKey.cc.
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 276 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 280 of file PublicKey.cc.
zypp::PublicKey::~PublicKey | ( | ) |
Definition at line 289 of file PublicKey.cc.
bool zypp::PublicKey::isValid | ( | ) | const [inline] |
Definition at line 110 of file PublicKey.h.
std::string zypp::PublicKey::asString | ( | ) | const |
Definition at line 298 of file PublicKey.cc.
std::string zypp::PublicKey::id | ( | ) | const |
Definition at line 301 of file PublicKey.cc.
std::string zypp::PublicKey::name | ( | ) | const |
Definition at line 304 of file PublicKey.cc.
std::string zypp::PublicKey::fingerprint | ( | ) | const |
Definition at line 307 of file PublicKey.cc.
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 310 of file PublicKey.cc.
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 313 of file PublicKey.cc.
Date zypp::PublicKey::created | ( | ) | const |
Date when the key was created.
Definition at line 316 of file PublicKey.cc.
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 319 of file PublicKey.cc.
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 322 of file PublicKey.cc.
bool zypp::PublicKey::expired | ( | ) | const |
Whether the key has expired.
Definition at line 325 of file PublicKey.cc.
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 328 of file PublicKey.cc.
Pathname zypp::PublicKey::path | ( | ) | const |
Definition at line 331 of file PublicKey.cc.
bool zypp::PublicKey::operator== | ( | PublicKey | b | ) | const |
Definition at line 334 of file PublicKey.cc.
bool zypp::PublicKey::operator== | ( | std::string | sid | ) | const |
Definition at line 341 of file PublicKey.cc.
std::ostream& operator<< | ( | std::ostream & | str, |
const PublicKey & | obj | ||
) | [friend] |
std::ostream & operator<< | ( | std::ostream & | str, |
const PublicKey & | obj | ||
) | [related] |
Stream output
Definition at line 193 of file PublicKey.h.
std::ostream & dumpOn | ( | std::ostream & | str, |
const PublicKey & | obj | ||
) | [related] |
Detailed stream output
Definition at line 346 of file PublicKey.cc.
RWCOW_pointer<Impl> zypp::PublicKey::_pimpl [private] |
Pointer to implementation.
Definition at line 188 of file PublicKey.h.