12 #ifndef ZYPP_KEYRING_H
13 #define ZYPP_KEYRING_H
175 KeyRing(
const Pathname &baseTmpDir);
184 void multiKeyImport(
const Pathname & keyfile_r,
bool trusted_r =
false );
192 void dumpPublicKey(
const std::string &
id,
bool trusted, std::ostream &stream );
220 void deleteKey(
const std::string &
id,
bool trusted =
false );
320 #endif // ZYPP_KEYRING_H
void importKey(const PublicKey &key, bool trusted=false)
imports a key from a file.
PublicKey exportTrustedPublicKey(const PublicKeyData &keyData)
Export a trusted public key identified by its key data.
void dumpTrustedPublicKey(const std::string &id, std::ostream &stream)
Helper filtering the files offered by a RepomdFileReader.
This basically means, we knew the key, but it was not trusted.
PublicKey exportPublicKey(const PublicKeyData &keyData)
Export a public key identified by its key data.
KeyRingException(const std::string &msg_r)
Ctor taking message.
Class representing one GPG Public Keys data.
void dumpPublicKey(const std::string &id, bool trusted, std::ostream &stream)
std::list< PublicKey > trustedPublicKeys()
Get a list of trusted public keys in the keyring (incl.
ZYPP_DECLARE_OPERATORS_FOR_FLAGS(DiskUsageCounter::MountPoint::HintFlags)
virtual bool askUserToAcceptUnsignedFile(const std::string &file, const KeyContext &keycontext=KeyContext())
KeyRing(const Pathname &baseTmpDir)
Default ctor.
std::list< PublicKeyData > trustedPublicKeyData()
Get a list of trusted public key data in the keyring (key data only)
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.
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...
KeyRingException()
Ctor taking message.
Internal connection to rpm database.
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.
ZYPP_DECLARE_FLAGS(DefaultAccept, DefaultAcceptBits)
KeyTrust
User reply options for the askUserToTrustKey callback.
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
static void setDefaultAccept(DefaultAccept value_r)
Set the active accept bits.
void dumpUntrustedPublicKey(const std::string &id, std::ostream &stream)
DEFINE_PTR_TYPE(Application)
std::ostream & operator<<(std::ostream &str, const KeyRing &)
virtual void trustedKeyAdded(const PublicKey &)
Base class for reference counted objects.
bool isKeyKnown(const std::string &id)
true if the key id is knows, that means at least exist on the untrusted keyring
void multiKeyImport(const Pathname &keyfile_r, bool trusted_r=false)
Initial import from RpmDb.
User has chosen not to trust the key.
DefaultAcceptBits
DefaultAccept flags (
virtual KeyTrust askUserToAcceptKey(const PublicKey &key, const KeyContext &keycontext=KeyContext())
Ask user to trust and/or import the key to trusted keyring.
static DefaultAccept defaultAccept()
Get the active accept bits.
RW_pointer< Impl > _pimpl
Pointer to implementation.
Class representing one GPG Public Key (PublicKeyData + ASCII armored in a tempfile).
std::list< PublicKeyData > publicKeyData()
Get a list of public key data in the keyring (key data only)
Base class for Exception.
Callbacks from signature verification workflow.
void deleteKey(const std::string &id, bool trusted=false)
removes a key from the keyring.
friend std::ostream & operator<<(std::ostream &str, const KeyRing &obj)
bool verifyFileTrustedSignature(const Pathname &file, const Pathname &signature)
bool isKeyTrusted(const std::string &id)
true if the key id is trusted
virtual void trustedKeyRemoved(const PublicKey &)
std::string readSignatureKeyId(const Pathname &signature)
reads the public key id from a signature
bool verifyFileSignature(const Pathname &file, const Pathname &signature)
Verifies a file against a signature, with no user interaction.
virtual ~KeyRingException()
Dtor.
virtual bool askUserToAcceptVerificationFailed(const std::string &file, const PublicKey &key, const KeyContext &keycontext=KeyContext())
The file filedesc is signed but the verification failed.
std::list< PublicKey > publicKeys()
Get a list of public keys in the keyring (incl.