libzypp 17.37.10

zypp::KeyRingReport Struct Reference

Callbacks from signature verification workflow. More...

`#include <zypp/KeyRing.h>`

Inheritance diagram for zypp::KeyRingReport:

## Public Types
enum | KeyTrust { KEY_DONT_TRUST = 0 , KEY_TRUST_TEMPORARILY , KEY_TRUST_AND_IMPORT }
| User reply options for the askUserToTrustKey callback. More...
Public Types inherited from zypp::callback::ReportBase
typedef callback::UserData | UserData
typedef UserData::ContentType | ContentType

## Public Member Functions
virtual KeyTrust | askUserToAcceptKey (const PublicKey &key, const KeyContext &keycontext=KeyContext())
| Ask user to trust and/or import the key to trusted keyring.
virtual void | infoVerify (const std::string &file_r, const PublicKeyData &keyData_r, const KeyContext &keycontext=KeyContext())
| Informal callback showing the trusted key that will be used for verification.
virtual bool | askUserToAcceptUnsignedFile (const std::string &file, const KeyContext &keycontext=KeyContext())
virtual bool | askUserToAcceptUnknownKey (const std::string &file, const std::string &id, const KeyContext &keycontext=KeyContext())
| we DONT know the key, only its id, but we have never seen it, the difference with trust key is that if you dont have it, you can't import it later.
virtual bool | askUserToAcceptVerificationFailed (const std::string &file, const PublicKey &key, const KeyContext &keycontext=KeyContext())
| The file filedesc is signed but the verification failed.
bool | askUserToAcceptPackageKey (const PublicKey &key_r, const KeyContext &keycontext_r=KeyContext())
| Ask user to trust and/or import the package key to trusted keyring, using ReportBase::report.
void | reportNonImportedKeys (const std::set< Edition > &keys_r)
| Notify the user about keys that were not imported from the rpm key database into zypp keyring.
void | reportAutoImportKey (const std::list< PublicKeyData > &keyDataList_r, const PublicKeyData &keySigning_r, const KeyContext &keyContext_r)
| Notify that a repository auto imported new package signing keys.
Public Member Functions inherited from zypp::callback::ReportBase
virtual void | report (const UserData &userData_r=UserData())
| The most generic way of sending/receiving data.
virtual | ~ReportBase ()

## Related Symbols
(Note that these are not member symbols.)
static constexpr const char * | ACCEPT_PACKAGE_KEY_REQUEST = "KeyRingReport/AcceptPackageKey"
| generic reports UserData::type
static constexpr const char * | KEYS_NOT_IMPORTED_REPORT = "KeyRingReport/KeysNotImported"
| generic reports UserData::type
static constexpr const char * | REPORT_AUTO_IMPORT_KEY = "KeyRingReport/reportAutoImportKey"
| generic reports UserData::type

## Detailed Description

Callbacks from signature verification workflow.

Per default all methods answer `false`. This may be canged by calling KeyRing::setDefaultAccept.

KeyRing::setDefaultAccept( KeyRing::ACCEPT_UNSIGNED_FILE | KeyRing::ACCEPT_VERIFICATION_FAILED );
zypp::KeyRing::setDefaultAccept
static void setDefaultAccept(DefaultAccept value_r)
Set the active accept bits.
Definition KeyRing.cc:56
zypp::KeyRing::ACCEPT_VERIFICATION_FAILED
@ ACCEPT_VERIFICATION_FAILED
Definition KeyRing.h:192
zypp::KeyRing::ACCEPT_UNSIGNED_FILE
@ ACCEPT_UNSIGNED_FILE
Definition KeyRing.h:188

See also
  KeyRing

Definition at line 46 of file KeyRing.h.

## Member Enumeration Documentation

## ◆ KeyTrust

enum zypp::KeyRingReport::KeyTrust

User reply options for the askUserToTrustKey callback.

Parameters

  filedes | Name of the file (repo alias) or filename if not available

Enumerator
KEY_DONT_TRUST | User has chosen not to trust the key.
KEY_TRUST_TEMPORARILY | This basically means, we knew the key, but it was not trusted. User has chosen to continue, but not import the key.
KEY_TRUST_AND_IMPORT | Import the key. This means saving the key in the trusted database so next run it will appear as trusted. Nothing to do with KEY_TRUST_TEMPORARILY, as you CAN trust a key without importing it, basically you will be asked every time again. There are programs who prefer to manage the trust keyring on their own and use trustKey without importing it into rpm.

Definition at line 53 of file KeyRing.h.

## Member Function Documentation

## ◆ askUserToAcceptKey()

KeyRingReport::KeyTrust zypp::KeyRingReport::askUserToAcceptKey | ( | const PublicKey & | key,
|  | const KeyContext & | keycontext = KeyContext() )
| virtual

Ask user to trust and/or import the key to trusted keyring.

See also
  KeyTrust

Definition at line 69 of file KeyRing.cc.

## ◆ infoVerify()

void zypp::KeyRingReport::infoVerify | ( | const std::string & | file_r,
|  | const PublicKeyData & | keyData_r,
|  | const KeyContext & | keycontext = KeyContext() )
| virtual

Informal callback showing the trusted key that will be used for verification.

Definition at line 62 of file KeyRing.cc.

## ◆ askUserToAcceptUnsignedFile()

bool zypp::KeyRingReport::askUserToAcceptUnsignedFile | ( | const std::string & | file,
|  | const KeyContext & | keycontext = KeyContext() )
| virtual

Definition at line 65 of file KeyRing.cc.

## ◆ askUserToAcceptUnknownKey()

bool zypp::KeyRingReport::askUserToAcceptUnknownKey | ( | const std::string & | file,
|  | const std::string & | id,
|  | const KeyContext & | keycontext = KeyContext() )
| virtual

we DONT know the key, only its id, but we have never seen it, the difference with trust key is that if you dont have it, you can't import it later.

The answer means continue yes or no?

Definition at line 78 of file KeyRing.cc.

## ◆ askUserToAcceptVerificationFailed()

bool zypp::KeyRingReport::askUserToAcceptVerificationFailed | ( | const std::string & | file,
|  | const PublicKey & | key,
|  | const KeyContext & | keycontext = KeyContext() )
| virtual

The file filedesc is signed but the verification failed.

Parameters

  filedesc | Filename or its description.

Definition at line 81 of file KeyRing.cc.

## ◆ askUserToAcceptPackageKey()

bool zypp::KeyRingReport::askUserToAcceptPackageKey | ( | const PublicKey & | key_r,
|  | const KeyContext & | keycontext_r = KeyContext() )

Ask user to trust and/or import the package key to trusted keyring, using ReportBase::report.

The UserData object will have the following fields: UserData::type PublicKey The PublicKey to be accepted "KeyContext" The KeyContext

Userdata accepted: "TrustKey" bool user can either trust or not trust the key

See also
  KeyTrust
  ReportBase::report

Note
  this is a non virtual function and will use ReportBase::report to send the report.

Definition at line 84 of file KeyRing.cc.

## ◆ reportNonImportedKeys()

void zypp::KeyRingReport::reportNonImportedKeys | ( | const std::set< Edition > & | keys_r | ) |

Notify the user about keys that were not imported from the rpm key database into zypp keyring.

The UserData object will have the following fields: UserData::type KEYS_NOT_IMPORTED_REPORT std::set<Edition> "Keys" set of keys that were not imported

Definition at line 96 of file KeyRing.cc.

## ◆ reportAutoImportKey()

void zypp::KeyRingReport::reportAutoImportKey | ( | const std::list< PublicKeyData > & | keyDataList_r,
|  | const PublicKeyData & | keySigning_r,
|  | const KeyContext & | keyContext_r )

Notify that a repository auto imported new package signing keys.

To auto import new package signing keys, the repositories metadata must be signed by an already trusted key.

The UserData object will have the following fields: UserData::type KeyDataList List of KeyData to import "KeySigning" KeyData of signing key "KeyContext" The KeyContext

Definition at line 103 of file KeyRing.cc.

## Friends And Related Symbol Documentation

## ◆ ACCEPT_PACKAGE_KEY_REQUEST

const char* ACCEPT_PACKAGE_KEY_REQUEST = "KeyRingReport/AcceptPackageKey"
| related

generic reports UserData::type

Definition at line 119 of file KeyRing.h.

## ◆ KEYS_NOT_IMPORTED_REPORT

const char* KEYS_NOT_IMPORTED_REPORT = "KeyRingReport/KeysNotImported"
| related

generic reports UserData::type

Definition at line 132 of file KeyRing.h.

## ◆ REPORT_AUTO_IMPORT_KEY

const char* REPORT_AUTO_IMPORT_KEY = "KeyRingReport/reportAutoImportKey"
| related

generic reports UserData::type

Definition at line 151 of file KeyRing.h.

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

- zypp/KeyRing.h
- zypp/KeyRing.cc