libzypp 17.31.23
zypp::KeyManagerCtx Class Reference

#include <KeyManager.h>

Classes

class  Impl
 

Public Member Functions

Pathname homedir () const
 Return the homedir/keyring.
 
std::list< PublicKeyDatalistKeys ()
 Returns a list of all public keys found in the current keyring.
 
std::list< PublicKeyDatareadKeyFromFile (const Pathname &file)
 Returns a list of all PublicKeyData found in file.
 
bool verify (const Pathname &file, const Pathname &signature)
 Tries to verify file using signature, returns true on success.
 
bool exportKey (const std::string &id, std::ostream &stream)
 Exports the key with id into the given stream, returns true on success.
 
bool importKey (const Pathname &keyfile)
 Tries to import a key from keyfile, returns true on success.
 
bool importKey (const ByteArray &keydata)
 Tries to import a key from buffer, returns true on success.
 
bool deleteKey (const std::string &id)
 Tries to delete a key specified by id, returns true on success.
 
std::list< std::string > readSignatureFingerprints (const Pathname &signature)
 Reads all fingerprints from the signature file , returns a list of all found fingerprints.
 
std::list< std::string > readSignatureFingerprints (const ByteArray &keyData)
 Reads all fingerprints from the buffer, returns a list of all found fingerprints.
 

Static Public Member Functions

static KeyManagerCtx createForOpenPGP ()
 Creates a new KeyManagerCtx for PGP using a volatile temp.
 
static KeyManagerCtx createForOpenPGP (const Pathname &keyring_r)
 Creates a new KeyManagerCtx for PGP using a custom homedir/keyring.
 

Private Member Functions

 KeyManagerCtx ()
 

Private Attributes

RW_pointer< Impl_pimpl
 Pointer to implementation.
 

Detailed Description

Definition at line 32 of file KeyManager.h.

Constructor & Destructor Documentation

◆ KeyManagerCtx()

zypp::KeyManagerCtx::KeyManagerCtx ( )
private

Definition at line 266 of file KeyManager.cc.

Member Function Documentation

◆ createForOpenPGP() [1/2]

KeyManagerCtx zypp::KeyManagerCtx::createForOpenPGP ( )
static

Creates a new KeyManagerCtx for PGP using a volatile temp.

homedir/keyring.

Mainly used with methods, which need a context but do not need a keyring (like readKeyFromFile or readSignatureFingerprints).

Note
The underlying keyring is intentionally NOT the users keyring. Think of it as a volatile keyring whose content may get cleared anytime.
Exceptions
KeyRingExceptionif context can not be created or set up

Definition at line 270 of file KeyManager.cc.

◆ createForOpenPGP() [2/2]

KeyManagerCtx zypp::KeyManagerCtx::createForOpenPGP ( const Pathname keyring_r)
static

Creates a new KeyManagerCtx for PGP using a custom homedir/keyring.

Note
If you explicitly pass an empty Pathname, no homedir/keyring will be set and GPGME will use its defaults.
Exceptions
KeyRingExceptionif context can not be created or set up

Definition at line 280 of file KeyManager.cc.

◆ homedir()

Pathname zypp::KeyManagerCtx::homedir ( ) const

Return the homedir/keyring.

Definition at line 311 of file KeyManager.cc.

◆ listKeys()

std::list< PublicKeyData > zypp::KeyManagerCtx::listKeys ( )

Returns a list of all public keys found in the current keyring.

Definition at line 319 of file KeyManager.cc.

◆ readKeyFromFile()

std::list< PublicKeyData > zypp::KeyManagerCtx::readKeyFromFile ( const Pathname file)

Returns a list of all PublicKeyData found in file.

Definition at line 349 of file KeyManager.cc.

◆ verify()

bool zypp::KeyManagerCtx::verify ( const Pathname file,
const Pathname signature 
)

Tries to verify file using signature, returns true on success.

Definition at line 372 of file KeyManager.cc.

◆ exportKey()

bool zypp::KeyManagerCtx::exportKey ( const std::string &  id,
std::ostream &  stream 
)

Exports the key with id into the given stream, returns true on success.

Definition at line 377 of file KeyManager.cc.

◆ importKey() [1/2]

bool zypp::KeyManagerCtx::importKey ( const Pathname keyfile)

Tries to import a key from keyfile, returns true on success.

Definition at line 446 of file KeyManager.cc.

◆ importKey() [2/2]

bool zypp::KeyManagerCtx::importKey ( const ByteArray keydata)

Tries to import a key from buffer, returns true on success.

Definition at line 465 of file KeyManager.cc.

◆ deleteKey()

bool zypp::KeyManagerCtx::deleteKey ( const std::string &  id)

Tries to delete a key specified by id, returns true on success.

Definition at line 504 of file KeyManager.cc.

◆ readSignatureFingerprints() [1/2]

std::list< std::string > zypp::KeyManagerCtx::readSignatureFingerprints ( const Pathname signature)

Reads all fingerprints from the signature file , returns a list of all found fingerprints.

Definition at line 532 of file KeyManager.cc.

◆ readSignatureFingerprints() [2/2]

std::list< std::string > zypp::KeyManagerCtx::readSignatureFingerprints ( const ByteArray keyData)

Reads all fingerprints from the buffer, returns a list of all found fingerprints.

Definition at line 535 of file KeyManager.cc.

Member Data Documentation

◆ _pimpl

RW_pointer<Impl> zypp::KeyManagerCtx::_pimpl
private

Pointer to implementation.

Definition at line 90 of file KeyManager.h.


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