libzypp  17.1.1
zypp::PublicKeyData Class Reference

Class representing one GPG Public Keys data. More...

#include <PublicKey.h>

Classes

class  Impl
 PublicKeyData implementation. More...
 

Public Types

typedef const PublicSubkeyDataSubkeyIterator
 

Public Member Functions

 PublicKeyData ()
 Default constructed: empty data. More...
 
 ~PublicKeyData ()
 
 operator bool () const
 Whether this contains valid data (not default constructed). More...
 
std::string id () const
 Key ID. More...
 
std::string name () const
 Key name. More...
 
std::string fingerprint () const
 Key fingerprint. More...
 
Date created () const
 Creation / last modification date (latest selfsig). More...
 
Date expires () const
 Expiry date, or Date() if the key never expires. More...
 
bool expired () const
 Whether the key has expired. More...
 
int daysToLive () const
 Number of days (24h) until the key expires (or since it exired). More...
 
std::string expiresAsString () const
 
std::string gpgPubkeyVersion () const
 Gpg-pubkey version as computed by rpm (trailing 8 byte id) More...
 
std::string gpgPubkeyRelease () const
 Gpg-pubkey release as computed by rpm (hexencoded created) More...
 
Edition gpgPubkeyEdition () const
 Gpg-pubkey Edition built from version and release. More...
 
std::string asString () const
 Simple string representation. More...
 
bool hasSubkeys () const
 Whether subkeys is not empty. More...
 
Iterable< SubkeyIteratorsubkeys () const
 Iterate any subkeys. More...
 
bool providesKey (const std::string &id_r) const
 Whether id_r is the id of the primary key or of a subkey. More...
 

Private Attributes

RWCOW_pointer< Impl_pimpl
 

Friends

class PublicKeyScanner
 
std::ostream & dumpOn (std::ostream &str, const PublicKeyData &obj)
 

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &str, const PublicKeyData &obj)
 
std::ostream & dumpOn (std::ostream &str, const PublicKeyData &obj)
 
bool operator== (const PublicKeyData &lhs, const PublicKeyData &rhs)
 
bool operator!= (const PublicKeyData &lhs, const PublicKeyData &rhs)
 

Detailed Description

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 133 of file PublicKey.h.

Member Typedef Documentation

◆ SubkeyIterator

Definition at line 203 of file PublicKey.h.

Constructor & Destructor Documentation

◆ PublicKeyData()

zypp::PublicKeyData::PublicKeyData ( )

Default constructed: empty data.

class PublicKeyData

Definition at line 212 of file PublicKey.cc.

◆ ~PublicKeyData()

zypp::PublicKeyData::~PublicKeyData ( )

Definition at line 216 of file PublicKey.cc.

Member Function Documentation

◆ operator bool()

zypp::PublicKeyData::operator bool ( ) const
explicit

Whether this contains valid data (not default constructed).

Definition at line 219 of file PublicKey.cc.

◆ id()

std::string zypp::PublicKeyData::id ( ) const

Key ID.

Definition at line 222 of file PublicKey.cc.

◆ name()

std::string zypp::PublicKeyData::name ( ) const

Key name.

Definition at line 225 of file PublicKey.cc.

◆ fingerprint()

std::string zypp::PublicKeyData::fingerprint ( ) const

Key fingerprint.

Definition at line 228 of file PublicKey.cc.

◆ created()

Date zypp::PublicKeyData::created ( ) const

Creation / last modification date (latest selfsig).

Definition at line 231 of file PublicKey.cc.

◆ expires()

Date zypp::PublicKeyData::expires ( ) const

Expiry date, or Date() if the key never expires.

Definition at line 234 of file PublicKey.cc.

◆ expired()

bool zypp::PublicKeyData::expired ( ) const

Whether the key has expired.

Definition at line 237 of file PublicKey.cc.

◆ daysToLive()

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 240 of file PublicKey.cc.

◆ expiresAsString()

std::string zypp::PublicKeyData::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 243 of file PublicKey.cc.

◆ gpgPubkeyVersion()

std::string zypp::PublicKeyData::gpgPubkeyVersion ( ) const

Gpg-pubkey version as computed by rpm (trailing 8 byte id)

Definition at line 246 of file PublicKey.cc.

◆ gpgPubkeyRelease()

std::string zypp::PublicKeyData::gpgPubkeyRelease ( ) const

Gpg-pubkey release as computed by rpm (hexencoded created)

Definition at line 249 of file PublicKey.cc.

◆ gpgPubkeyEdition()

Edition zypp::PublicKeyData::gpgPubkeyEdition ( ) const
inline

Gpg-pubkey Edition built from version and release.

Definition at line 191 of file PublicKey.h.

◆ asString()

std::string zypp::PublicKeyData::asString ( ) const

Simple string representation.

Encodes id, gpgPubkeyRelease, name and fingerprint.

[E3A5C360307E3D54-4be01a65] [SuSE Package Signing Key <build@suse.de>] [4E98E67519D98DC7362A5990E3A5C360307E3D54]

Definition at line 252 of file PublicKey.cc.

◆ hasSubkeys()

bool zypp::PublicKeyData::hasSubkeys ( ) const

Whether subkeys is not empty.

Definition at line 261 of file PublicKey.cc.

◆ subkeys()

Iterable< PublicKeyData::SubkeyIterator > zypp::PublicKeyData::subkeys ( ) const

Iterate any subkeys.

Definition at line 264 of file PublicKey.cc.

◆ providesKey()

bool zypp::PublicKeyData::providesKey ( const std::string &  id_r) const

Whether id_r is the id of the primary key or of a subkey.

Definition at line 267 of file PublicKey.cc.

Friends And Related Function Documentation

◆ PublicKeyScanner

friend class PublicKeyScanner
friend

Definition at line 217 of file PublicKey.h.

◆ dumpOn [1/2]

std::ostream& dumpOn ( std::ostream &  str,
const PublicKeyData obj 
)
friend

Definition at line 270 of file PublicKey.cc.

◆ operator<<()

std::ostream & operator<< ( std::ostream &  str,
const PublicKeyData obj 
)
related

Stream output

Definition at line 223 of file PublicKey.h.

◆ dumpOn() [2/2]

std::ostream & dumpOn ( std::ostream &  str,
const PublicKeyData obj 
)
related

Detailed stream output

Definition at line 270 of file PublicKey.cc.

◆ operator==()

bool operator== ( const PublicKeyData lhs,
const PublicKeyData rhs 
)
related

Equal based on fingerprint anf creation date.

Definition at line 284 of file PublicKey.cc.

◆ operator!=()

bool operator!= ( const PublicKeyData lhs,
const PublicKeyData rhs 
)
related

NotEqual.

Definition at line 233 of file PublicKey.h.

Member Data Documentation

◆ _pimpl

RWCOW_pointer<Impl> zypp::PublicKeyData::_pimpl
private

Definition at line 215 of file PublicKey.h.


The documentation for this class was generated from the following files: