libzypp: zypp::KeyRingImpl Class Reference

libzypp 17.38.11

zypp::KeyRingImpl Class Reference

KeyRing implementation, shared between zyppng and zypp. More...

`#include <zypp-common/private/keyring_p.h>`

Inheritance diagram for zypp::KeyRingImpl:

## Public Types
enum class | Ring : bool { General = false , Trusted = true }
enum class | MustUpdate { Present = 0 , Missing = 1 , Update = 2 }

## Public Member Functions
zyppng::SignalProxy< void(const PublicKey &)> | sigTrustedKeyAdded ()
zyppng::SignalProxy< void(const PublicKey &)> | sigTrustedKeyRemoved ()
| KeyRingImpl (const Pathname &baseTmpDir)
void | allowPreload (bool yesno_r)
void | importKey (const PublicKey &key, const Ring ring)
| Import PublicKeys into a Ring.
void | importKeys (const std::list< PublicKey > &keys, const Ring ring)
PublicKey | exportKey (const std::string &id, const Ring ring) const
PublicKey | exportKey (const PublicKeyData &keyData, const Ring ring) const
PublicKey | exportKey (const PublicKey &key, const Ring ring) const
void | deleteKey (const std::string &id, const Ring ring)
void | dumpPublicKey (const std::string &id, const Ring ring, std::ostream &stream)
bool | verifyFile (const Pathname &file, const Pathname &signature, const Ring ring)
std::string | readSignatureKeyId (const Pathname &signature)
void | multiKeyImport (const Pathname &keyfile_r, const Ring ring)
| Used by RpmDB to import the trusted keys.
MustUpdate | mustUpdateData (const PublicKeyData &keyData, const Ring ring) const
| Helper computing PublicKeyData's status in a Ring.
bool | isKeyTrusted (const std::string &id) const
bool | isKeyKnown (const std::string &id) const
PublicKeyData | publicKeyData (const std::string &id, const Ring ring) const
PublicKeyData | publicKeyData (const PublicKeyData &keyData, const Ring ring) const
PublicKeyData | publicKeyData (const PublicKey &key, const Ring ring) const
const std::list< PublicKeyData > & | publicKeyData (const Ring ring) const
std::list< PublicKey > | publicKeys (const Ring ring) const

## Private Member Functions
const Pathname | keyRingPath (const Ring ring) const
void | importKey (const Pathname &keyfile, const Pathname &keyring)
PublicKey | exportKey (const std::string &id, const Pathname &keyring) const
PublicKey | exportKey (const PublicKeyData &keyData, const Pathname &keyring) const
void | deleteKey (const std::string &id, const Pathname &keyring)
PublicKeyData | publicKeyData (const std::string &id, const Pathname &keyring) const
const std::list< PublicKeyData > & | publicKeyData (const Pathname &keyring) const
std::list< PublicKey > | publicKeys (const Pathname &keyring) const
void | dumpPublicKey (const std::string &id, const Pathname &keyring, std::ostream &stream) const
filesystem::TmpFile | dumpPublicKeyToTmp (const std::string &id, const Pathname &keyring) const
bool | verifyFile (const Pathname &file, const Pathname &signature, const Pathname &keyring)
void | preloadCachedKeys ()
| Load key files cached on the system into the generalKeyRing.
CachedPublicKeyData::Manip | keyRingManip (const Pathname &keyring)
| Impl helper providing on demand a KeyManagerCtx to manip a cached keyring.

## Private Attributes
filesystem::TmpDir | _trusted_tmp_dir
filesystem::TmpDir | _general_tmp_dir
Pathname | _base_dir
bool | _allowPreload = false
CachedPublicKeyData | cachedPublicKeyData
| Functor returning the keyrings data (cached).
zyppng::Signal< void(const PublicKey &)> | _sigTrustedKeyAdded
zyppng::Signal< void(const PublicKey &)> | _sigTrustedKeyRemoved

## Detailed Description

KeyRing implementation, shared between zyppng and zypp.

Definition at line 90 of file keyring_p.h.

## Member Enumeration Documentation

## ◆ Ring

enum class zypp::KeyRingImpl::Ring : bool
| strong

Enumerator
General |
Trusted |

Definition at line 93 of file keyring_p.h.

## ◆ MustUpdate

enum class zypp::KeyRingImpl::MustUpdate
| strong

Enumerator
Present | Key is in Ring.
Missing | Key is not in Ring.
Update | old version of Key is in Ring

Definition at line 143 of file keyring_p.h.

## Constructor & Destructor Documentation

## ◆ KeyRingImpl()

zypp::KeyRingImpl::KeyRingImpl | ( | const Pathname & | baseTmpDir | ) |

Definition at line 112 of file keyring_p.cc.

## Member Function Documentation

## ◆ sigTrustedKeyAdded()

zyppng::SignalProxy< void(const PublicKey &)> zypp::KeyRingImpl::sigTrustedKeyAdded | ( |  | ) |
| inline

Definition at line 98 of file keyring_p.h.

## ◆ sigTrustedKeyRemoved()

zyppng::SignalProxy< void(const PublicKey &)> zypp::KeyRingImpl::sigTrustedKeyRemoved | ( |  | ) |
| inline

Definition at line 101 of file keyring_p.h.

## ◆ allowPreload()

void zypp::KeyRingImpl::allowPreload | ( | bool | yesno_r | ) |
| inline

Definition at line 108 of file keyring_p.h.

## ◆ importKey() [1/2]

void zypp::KeyRingImpl::importKey | ( | const PublicKey & | key,
|  | const Ring | ring )

Import PublicKeys into a Ring.

Beware that a PublicKey constructed from a file may in fact hold multiple keys (

See also
  PublicKey::hiddenKeys)

Definition at line 120 of file keyring_p.cc.

## ◆ importKeys()

void zypp::KeyRingImpl::importKeys | ( | const std::list< PublicKey > & | keys,
|  | const Ring | ring )

Definition at line 196 of file keyring_p.cc.

## ◆ exportKey() [1/5]

PublicKey zypp::KeyRingImpl::exportKey | ( | const std::string & | id,
|  | const Ring | ring ) const
| inline

Definition at line 118 of file keyring_p.h.

## ◆ exportKey() [2/5]

PublicKey zypp::KeyRingImpl::exportKey | ( | const PublicKeyData & | keyData,
|  | const Ring | ring ) const
| inline

Definition at line 120 of file keyring_p.h.

## ◆ exportKey() [3/5]

PublicKey zypp::KeyRingImpl::exportKey | ( | const PublicKey & | key,
|  | const Ring | ring ) const
| inline

Definition at line 122 of file keyring_p.h.

## ◆ deleteKey() [1/2]

void zypp::KeyRingImpl::deleteKey | ( | const std::string & | id,
|  | const Ring | ring )

Definition at line 209 of file keyring_p.cc.

## ◆ dumpPublicKey() [1/2]

void zypp::KeyRingImpl::dumpPublicKey | ( | const std::string & | id,
|  | const Ring | ring,
|  | std::ostream & | stream )
| inline

Definition at line 127 of file keyring_p.h.

## ◆ verifyFile() [1/2]

bool zypp::KeyRingImpl::verifyFile | ( | const Pathname & | file,
|  | const Pathname & | signature,
|  | const Ring | ring )
| inline

Definition at line 130 of file keyring_p.h.

## ◆ readSignatureKeyId()

std::string zypp::KeyRingImpl::readSignatureKeyId | ( | const Pathname & | signature | ) |

Definition at line 310 of file keyring_p.cc.

## ◆ multiKeyImport()

void zypp::KeyRingImpl::multiKeyImport | ( | const Pathname & | keyfile_r,
|  | const Ring | ring )

Used by RpmDB to import the trusted keys.

Use with care - it's a silent import of all keys. No extra logging. Wrap keyfile_r into a PublicKey and call importKey to get the same result plus the log lines.

Definition at line 203 of file keyring_p.cc.

## ◆ mustUpdateData()

MustUpdate zypp::KeyRingImpl::mustUpdateData | ( | const PublicKeyData & | keyData,
|  | const Ring | ring ) const
| inline

Helper computing PublicKeyData's status in a Ring.

Definition at line 149 of file keyring_p.h.

## ◆ isKeyTrusted()

bool zypp::KeyRingImpl::isKeyTrusted | ( | const std::string & | id | ) | const
| inline

Definition at line 161 of file keyring_p.h.

## ◆ isKeyKnown()

bool zypp::KeyRingImpl::isKeyKnown | ( | const std::string & | id | ) | const
| inline

Definition at line 164 of file keyring_p.h.

## ◆ publicKeyData() [1/6]

PublicKeyData zypp::KeyRingImpl::publicKeyData | ( | const std::string & | id,
|  | const Ring | ring ) const
| inline

Definition at line 167 of file keyring_p.h.

## ◆ publicKeyData() [2/6]

PublicKeyData zypp::KeyRingImpl::publicKeyData | ( | const PublicKeyData & | keyData,
|  | const Ring | ring ) const
| inline

Definition at line 169 of file keyring_p.h.

## ◆ publicKeyData() [3/6]

PublicKeyData zypp::KeyRingImpl::publicKeyData | ( | const PublicKey & | key,
|  | const Ring | ring ) const
| inline

Definition at line 171 of file keyring_p.h.

## ◆ publicKeyData() [4/6]

const std::list< PublicKeyData > & zypp::KeyRingImpl::publicKeyData | ( | const Ring | ring | ) | const
| inline

Definition at line 174 of file keyring_p.h.

## ◆ publicKeys() [1/2]

std::list< PublicKey > zypp::KeyRingImpl::publicKeys | ( | const Ring | ring | ) | const
| inline

Definition at line 177 of file keyring_p.h.

## ◆ keyRingPath()

const Pathname zypp::KeyRingImpl::keyRingPath | ( | const Ring | ring | ) | const
| inlineprivate

Definition at line 182 of file keyring_p.h.

## ◆ importKey() [2/2]

void zypp::KeyRingImpl::importKey | ( | const Pathname & | keyfile,
|  | const Pathname & | keyring )
| private

Definition at line 226 of file keyring_p.cc.

## ◆ exportKey() [4/5]

PublicKey zypp::KeyRingImpl::exportKey | ( | const std::string & | id,
|  | const Pathname & | keyring ) const
| private

Definition at line 245 of file keyring_p.cc.

## ◆ exportKey() [5/5]

PublicKey zypp::KeyRingImpl::exportKey | ( | const PublicKeyData & | keyData,
|  | const Pathname & | keyring ) const
| private

Definition at line 239 of file keyring_p.cc.

## ◆ deleteKey() [2/2]

void zypp::KeyRingImpl::deleteKey | ( | const std::string & | id,
|  | const Pathname & | keyring )
| private

Definition at line 256 of file keyring_p.cc.

## ◆ publicKeyData() [5/6]

PublicKeyData zypp::KeyRingImpl::publicKeyData | ( | const std::string & | id,
|  | const Pathname & | keyring ) const
| private

Definition at line 264 of file keyring_p.cc.

## ◆ publicKeyData() [6/6]

const std::list< PublicKeyData > & zypp::KeyRingImpl::publicKeyData | ( | const Pathname & | keyring | ) | const
| inlineprivate

Definition at line 194 of file keyring_p.h.

## ◆ publicKeys() [2/2]

std::list< PublicKey > zypp::KeyRingImpl::publicKeys | ( | const Pathname & | keyring | ) | const
| private

Definition at line 279 of file keyring_p.cc.

## ◆ dumpPublicKey() [2/2]

void zypp::KeyRingImpl::dumpPublicKey | ( | const std::string & | id,
|  | const Pathname & | keyring,
|  | std::ostream & | stream ) const
| private

Definition at line 294 of file keyring_p.cc.

## ◆ dumpPublicKeyToTmp()

filesystem::TmpFile zypp::KeyRingImpl::dumpPublicKeyToTmp | ( | const std::string & | id,
|  | const Pathname & | keyring ) const
| private

Definition at line 299 of file keyring_p.cc.

## ◆ verifyFile() [2/2]

bool zypp::KeyRingImpl::verifyFile | ( | const Pathname & | file,
|  | const Pathname & | signature,
|  | const Pathname & | keyring )
| private

Definition at line 326 of file keyring_p.cc.

## ◆ preloadCachedKeys()

void zypp::KeyRingImpl::preloadCachedKeys | ( |  | ) |
| private

Load key files cached on the system into the generalKeyRing.

Definition at line 330 of file keyring_p.cc.

## ◆ keyRingManip()

CachedPublicKeyData::Manip zypp::KeyRingImpl::keyRingManip | ( | const Pathname & | keyring | ) |
| inlineprivate

Impl helper providing on demand a KeyManagerCtx to manip a cached keyring.

Definition at line 216 of file keyring_p.h.

## Member Data Documentation

## ◆ _trusted_tmp_dir

filesystem::TmpDir zypp::KeyRingImpl::_trusted_tmp_dir
| private

Definition at line 221 of file keyring_p.h.

## ◆ _general_tmp_dir

filesystem::TmpDir zypp::KeyRingImpl::_general_tmp_dir
| private

Definition at line 222 of file keyring_p.h.

## ◆ _base_dir

Pathname zypp::KeyRingImpl::_base_dir
| private

Definition at line 223 of file keyring_p.h.

## ◆ _allowPreload

bool zypp::KeyRingImpl::_allowPreload = false
| private

Definition at line 224 of file keyring_p.h.

## ◆ cachedPublicKeyData

CachedPublicKeyData zypp::KeyRingImpl::cachedPublicKeyData
| private

Functor returning the keyrings data (cached).

const std::list<PublicKeyData> & cachedPublicKeyData( const Pathname & keyring );
zypp::KeyRingImpl::cachedPublicKeyData
CachedPublicKeyData cachedPublicKeyData
Functor returning the keyrings data (cached).
Definition keyring_p.h:231
zypp::filesystem::Pathname
Pathname.
Definition Pathname.h:48
zypp::keyring
Definition KeyRingContexts.cc:18

Definition at line 231 of file keyring_p.h.

## ◆ _sigTrustedKeyAdded

zyppng::Signal<void ( const PublicKey & )> zypp::KeyRingImpl::_sigTrustedKeyAdded
| private

Definition at line 233 of file keyring_p.h.

## ◆ _sigTrustedKeyRemoved

zyppng::Signal<void ( const PublicKey & )> zypp::KeyRingImpl::_sigTrustedKeyRemoved
| private

Definition at line 234 of file keyring_p.h.

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

- zypp-common/private/keyring_p.h
- zypp-common/private/keyring_p.cc