21#include <zypp/base/ReferenceCounted.h>
22#include <zypp/base/Flags.h>
24#include <zypp/base/PtrTypes.h>
243 void dumpPublicKey(
const std::string &
id,
bool trusted, std::ostream &stream );
271 void deleteKey(
const std::string &
id,
bool trusted =
false );
Base class for Exception.
virtual ~KeyRingException()
Dtor.
KeyRingException()
Ctor taking message.
KeyRingException(const std::string &msg_r)
Ctor taking message.
bool provideAndImportKeyFromRepositoryWorkflow(const std::string &id, const RepoInfo &info)
Try to find the id in key cache or repository specified in info.
std::ostream & operator<<(std::ostream &str, const KeyRing &)
Stream output.
bool isKeyKnown(const std::string &id)
true if the key id is knows, that means at least exist on the untrusted keyring
std::list< PublicKey > publicKeys()
Get a list of public keys in the keyring (incl.
ZYPP_DECLARE_FLAGS(DefaultAccept, DefaultAcceptBits)
std::list< PublicKey > trustedPublicKeys()
Get a list of trusted public keys in the keyring (incl.
static DefaultAccept defaultAccept()
Get the active accept bits.
void dumpTrustedPublicKey(const std::string &id, std::ostream &stream)
void dumpPublicKey(const std::string &id, bool trusted, std::ostream &stream)
bool verifyFileSignature(const Pathname &file, const Pathname &signature)
Verifies a file against a signature, with no user interaction.
friend std::ostream & operator<<(std::ostream &str, const KeyRing &obj)
void multiKeyImport(const Pathname &keyfile_r, bool trusted_r=false)
Initial import from RpmDb.
PublicKey exportPublicKey(const PublicKeyData &keyData)
Export a public key identified by its key data.
std::string readSignatureKeyId(const Pathname &signature)
reads the public key id from a signature
void allowPreload(bool yesno_r)
The general keyring may be populated with known keys stored on the system.
void dumpUntrustedPublicKey(const std::string &id, std::ostream &stream)
bool verifyFileTrustedSignature(const Pathname &file, const Pathname &signature)
void importKey(const PublicKey &key, bool trusted=false)
imports a key from a file.
bool verifyFileSignatureWorkflow(const Pathname &file, const std::string &filedesc, const Pathname &signature, bool &sigValid_r, const KeyContext &keycontext=KeyContext())
Follows a signature verification interacting with the user.
RW_pointer< Impl > _pimpl
Pointer to implementation.
void deleteKey(const std::string &id, bool trusted=false)
removes a key from the keyring.
std::list< PublicKeyData > trustedPublicKeyData()
Get a list of trusted public key data in the keyring (key data only)
static void setDefaultAccept(DefaultAccept value_r)
Set the active accept bits.
std::list< PublicKeyData > publicKeyData()
Get a list of public key data in the keyring (key data only)
DefaultAcceptBits
DefaultAccept flags (
@ ACCEPT_VERIFICATION_FAILED
PublicKey exportTrustedPublicKey(const PublicKeyData &keyData)
Export a trusted public key identified by its key data.
bool isKeyTrusted(const std::string &id)
true if the key id is trusted
Class representing one GPG Public Keys data.
Class representing one GPG Public Key (PublicKeyData + ASCII armored in a tempfile).
What is known about a repository.
Base class for reference counted objects.
I/O context for KeyRing::verifyFileSignatureWorkflow.
String related utilities and Regular expression matching.
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
Easy-to use interface to the ZYPP dependency resolver.
Callbacks from signature verification workflow.
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.
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.
KeyTrust
User reply options for the askUserToTrustKey callback.
@ KEY_TRUST_AND_IMPORT
Import the key.
@ 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.
static constexpr const char * REPORT_AUTO_IMPORT_KEY
generic reports UserData::type
virtual bool askUserToAcceptUnsignedFile(const std::string &file, const KeyContext &keycontext=KeyContext())
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.
static constexpr const char * ACCEPT_PACKAGE_KEY_REQUEST
generic reports UserData::type
static constexpr const char * KEYS_NOT_IMPORTED_REPORT
generic reports UserData::type
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.
virtual KeyTrust askUserToAcceptKey(const PublicKey &key, const KeyContext &keycontext=KeyContext())
Ask user to trust and/or import the key to trusted keyring.
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 i...
virtual bool askUserToAcceptVerificationFailed(const std::string &file, const PublicKey &key, const KeyContext &keycontext=KeyContext())
The file filedesc is signed but the verification failed.
virtual void trustedKeyAdded(const PublicKey &)
virtual void trustedKeyRemoved(const PublicKey &)
Wrapper for const correct access via Smart pointer types.
Internal connection to rpm database.
#define ZYPP_DECLARE_OPERATORS_FOR_FLAGS(Name)
#define DEFINE_PTR_TYPE(NAME)
Forward declaration of Ptr types.