12 #ifndef ZYPP_KEYRING_H
13 #define ZYPP_KEYRING_H
172 KeyRing(
const Pathname &baseTmpDir);
181 void multiKeyImport(
const Pathname & keyfile_r,
bool trusted_r =
false );
189 void dumpPublicKey(
const std::string &
id,
bool trusted, std::ostream &stream );
217 void deleteKey(
const std::string &
id,
bool trusted =
false );
264 const Pathname &file,
265 const std::string filedesc,
266 const Pathname &signature,
314 #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.
bool verifyFileSignatureWorkflow(const Pathname &file, const std::string filedesc, const Pathname &signature, const KeyContext &keycontext=KeyContext())
Follows a signature verification interacting with the user.
void dumpTrustedPublicKey(const std::string &id, std::ostream &stream)
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.
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)
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.
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)
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.
Wrapper for const correct access via Smart pointer types.
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 &)
ZYPP_DECLARE_OPERATORS_FOR_FLAGS(FetcherJob::Flags)
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.