libzypp  15.28.6
zypp::PublicKey Class Reference

Class representing one GPG Public Key (PublicKeyData + ASCII armored in a tempfile). More...

#include <PublicKey.h>

Classes

class  Impl
 PublicKey implementation. More...
 

Public Types

typedef
PublicKeyData::SubkeyIterator 
SubkeyIterator
 

Public Member Functions

 PublicKey ()
 Default ctor. More...
 
 PublicKey (const Pathname &keyFile_r)
 Ctor taking the key from a file. More...
 
 PublicKey (const filesystem::TmpFile &sharedFile_r)
 Ctor reading the key from a TmpFile. More...
 
 ~PublicKey ()
 
const PublicKeyDatakeyData () const
 The public keys data (. More...
 
bool isValid () const
 
std::string id () const
 
std::string name () const
 
std::string fingerprint () const
 
Date created () const
 
Date expires () const
 
std::string expiresAsString () const
 
bool expired () const
 
int daysToLive () const
 
std::string gpgPubkeyVersion () const
 
std::string gpgPubkeyRelease () const
 
std::string asString () const
 
bool hasSubkeys () const
 !< More...
 
Iterable< SubkeyIteratorsubkeys () const
 !< More...
 
bool providesKey (const std::string &id_r) const
 !< More...
 
Pathname path () const
 File containig the ASCII armored key. More...
 
const std::list< PublicKeyData > & hiddenKeys () const
 Additional keys data in case the ASCII armored blob containes multiple keys. More...
 
bool operator== (const PublicKey &rhs) const
 
bool operator== (const std::string &sid) const
 

Private Member Functions

 PublicKey (const filesystem::TmpFile &sharedFile_r, const PublicKeyData &keyData_r)
 KeyRing ctor: No need to parse file if KeyRing already had valid KeyData. More...
 

Private Attributes

RWCOW_pointer< Impl_pimpl
 Pointer to implementation. More...
 

Friends

class KeyRing
 

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)
 

Detailed Description

Class representing one GPG Public Key (PublicKeyData + ASCII armored in a tempfile).

If you don't need the ASCII armored version of the key stored in a tempfile, using PublicKeyData might be sufficient.

Note
In case the ASCII armored blob actually contains multiple keys, the last keys data are made available via the API. The additional keys data are made available via hiddenKeys.

Definition at line 277 of file PublicKey.h.

Member Typedef Documentation

Constructor & Destructor Documentation

zypp::PublicKey::PublicKey ( )

Default ctor.

Definition at line 560 of file PublicKey.cc.

zypp::PublicKey::PublicKey ( const Pathname &  keyFile_r)
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.

Exceptions
whendata does not make a key

Definition at line 564 of file PublicKey.cc.

zypp::PublicKey::PublicKey ( const filesystem::TmpFile sharedFile_r)
explicit

Ctor reading the key from a TmpFile.

PublicKey holds a reference on the TmpFile providing the key.

Exceptions
whendata does not make a key

Definition at line 568 of file PublicKey.cc.

zypp::PublicKey::~PublicKey ( )

Definition at line 576 of file PublicKey.cc.

zypp::PublicKey::PublicKey ( const filesystem::TmpFile sharedFile_r,
const PublicKeyData keyData_r 
)
private

KeyRing ctor: No need to parse file if KeyRing already had valid KeyData.

Definition at line 572 of file PublicKey.cc.

Member Function Documentation

const PublicKeyData & zypp::PublicKey::keyData ( ) const

The public keys data (.

See Also
PublicKeyData).

Definition at line 579 of file PublicKey.cc.

bool zypp::PublicKey::isValid ( ) const
inline

Definition at line 313 of file PublicKey.h.

std::string zypp::PublicKey::id ( ) const
See Also
PublicKeyData

Definition at line 588 of file PublicKey.cc.

std::string zypp::PublicKey::name ( ) const
See Also
PublicKeyData

Definition at line 591 of file PublicKey.cc.

std::string zypp::PublicKey::fingerprint ( ) const
See Also
PublicKeyData

Definition at line 594 of file PublicKey.cc.

Date zypp::PublicKey::created ( ) const
See Also
PublicKeyData

Definition at line 597 of file PublicKey.cc.

Date zypp::PublicKey::expires ( ) const
See Also
PublicKeyData

Definition at line 600 of file PublicKey.cc.

std::string zypp::PublicKey::expiresAsString ( ) const
See Also
PublicKeyData

Definition at line 609 of file PublicKey.cc.

bool zypp::PublicKey::expired ( ) const
See Also
PublicKeyData

Definition at line 603 of file PublicKey.cc.

int zypp::PublicKey::daysToLive ( ) const
See Also
PublicKeyData

Definition at line 606 of file PublicKey.cc.

std::string zypp::PublicKey::gpgPubkeyVersion ( ) const
See Also
PublicKeyData

Definition at line 612 of file PublicKey.cc.

std::string zypp::PublicKey::gpgPubkeyRelease ( ) const
See Also
PublicKeyData

Definition at line 615 of file PublicKey.cc.

std::string zypp::PublicKey::asString ( ) const
See Also
PublicKeyData

Definition at line 618 of file PublicKey.cc.

bool zypp::PublicKey::hasSubkeys ( ) const
inline

!<

See Also
PublicKeyData

Definition at line 328 of file PublicKey.h.

Iterable<SubkeyIterator> zypp::PublicKey::subkeys ( ) const
inline

!<

See Also
PublicKeyData

Definition at line 331 of file PublicKey.h.

bool zypp::PublicKey::providesKey ( const std::string &  id_r) const
inline

!<

See Also
PublicKeyData

Definition at line 334 of file PublicKey.h.

Pathname zypp::PublicKey::path ( ) const

File containig the ASCII armored key.

Definition at line 582 of file PublicKey.cc.

const std::list< PublicKeyData > & zypp::PublicKey::hiddenKeys ( ) const

Additional keys data in case the ASCII armored blob containes multiple keys.

Definition at line 585 of file PublicKey.cc.

bool zypp::PublicKey::operator== ( const PublicKey rhs) const

Definition at line 621 of file PublicKey.cc.

bool zypp::PublicKey::operator== ( const std::string &  sid) const

Definition at line 624 of file PublicKey.cc.

Friends And Related Function Documentation

friend class KeyRing
friend

Definition at line 349 of file PublicKey.h.

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

Stream output

Definition at line 360 of file PublicKey.h.

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

Detailed stream output

Definition at line 627 of file PublicKey.cc.

Member Data Documentation

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

Pointer to implementation.

Definition at line 355 of file PublicKey.h.


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