Go to the documentation of this file.
12 #ifndef ZYPP_KEYRING_H
13 #define ZYPP_KEYRING_H
225 void dumpPublicKey(
const std::string &
id,
bool trusted, std::ostream &stream );
253 void deleteKey(
const std::string &
id,
bool trusted =
false );
364 #endif // ZYPP_KEYRING_H
void deleteKey(const std::string &id, bool trusted=false)
removes a key from the keyring.
PublicKey exportPublicKey(const PublicKeyData &keyData)
Export a public key identified by its key data.
DEFINE_PTR_TYPE(Application)
friend std::ostream & operator<<(std::ostream &str, const KeyRing &obj)
Base class for Exception.
What is known about a repository.
RW_pointer< Impl > _pimpl
Pointer to implementation.
void multiKeyImport(const Pathname &keyfile_r, bool trusted_r=false)
Initial import from RpmDb.
@ KEY_TRUST_TEMPORARILY
This basically means, we knew the key, but it was not trusted.
Class representing one GPG Public Keys data. PublicKeyData are provided e.g. by a PublicKey or a KeyR...
KeyRing(const Pathname &baseTmpDir)
Default ctor.
std::list< PublicKey > trustedPublicKeys()
Get a list of trusted public keys in the keyring (incl.
@ KEY_TRUST_AND_IMPORT
Import the key.
Base class for reference counted objects.
std::ostream & operator<<(std::ostream &str, const KeyRing &)
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.
bool isKeyKnown(const std::string &id)
true if the key id is knows, that means at least exist on the untrusted keyring
PublicKey exportTrustedPublicKey(const PublicKeyData &keyData)
Export a trusted public key identified by its key data.
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.
bool verifyFileTrustedSignature(const Pathname &file, const Pathname &signature)
static DefaultAccept defaultAccept()
Get the active accept bits.
virtual KeyTrust askUserToAcceptKey(const PublicKey &key, const KeyContext &keycontext=KeyContext())
Ask user to trust and/or import the key to trusted keyring.
std::string readSignatureKeyId(const Pathname &signature)
reads the public key id from a signature
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...
ZYPP_DECLARE_FLAGS(DefaultAccept, DefaultAcceptBits)
virtual bool askUserToAcceptUnsignedFile(const std::string &file, const KeyContext &keycontext=KeyContext())
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
void importKey(const PublicKey &key, bool trusted=false)
imports a key from a file.
ZYPP_DECLARE_OPERATORS_FOR_FLAGS(DiskUsageCounter::MountPoint::HintFlags)
constexpr static const char * ACCEPT_PACKAGE_KEY_REQUEST
static void setDefaultAccept(DefaultAccept value_r)
Set the active accept bits.
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.
Easy-to use interface to the ZYPP dependency resolver.
void dumpUntrustedPublicKey(const std::string &id, std::ostream &stream)
Internal connection to rpm database.
virtual void trustedKeyAdded(const PublicKey &)
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.
std::list< PublicKey > publicKeys()
Get a list of public keys in the keyring (incl.
KeyRingException(const std::string &msg_r)
Ctor taking message.
KeyRingException()
Ctor taking message.
Class representing one GPG Public Key (PublicKeyData + ASCII armored in a tempfile).
KeyTrust
User reply options for the askUserToTrustKey callback.
virtual void trustedKeyRemoved(const PublicKey &)
Callbacks from signature verification workflow.
std::list< PublicKeyData > trustedPublicKeyData()
Get a list of trusted public key data in the keyring (key data only)
bool provideAndImportKeyFromRepositoryWorkflow(const std::string &id, const RepoInfo &info)
Try to find the id in key cache or repository specified in info.
@ ACCEPT_VERIFICATION_FAILED
@ KEY_DONT_TRUST
User has chosen not to trust the key.
String related utilities and Regular expression matching.
bool isKeyTrusted(const std::string &id)
true if the key id is trusted
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.
virtual bool askUserToAcceptVerificationFailed(const std::string &file, const PublicKey &key, const KeyContext &keycontext=KeyContext())
The file filedesc is signed but the verification failed.
DefaultAcceptBits
DefaultAccept flags (
void dumpTrustedPublicKey(const std::string &id, std::ostream &stream)
virtual ~KeyRingException()
Dtor.
std::list< PublicKeyData > publicKeyData()
Get a list of public key data in the keyring (key data only)
constexpr static const char * KEYS_NOT_IMPORTED_REPORT