12 #ifndef ZYPP_KEYRING_H 13 #define ZYPP_KEYRING_H 28 #include <zypp-common/PublicKey.h> 29 #include <zypp-common/KeyRingException.h> 79 virtual KeyTrust askUserToAcceptKey(
const PublicKey &key,
const KeyContext &keycontext =
KeyContext() );
82 virtual void infoVerify(
const std::string & file_r,
const PublicKeyData & keyData_r,
const KeyContext &keycontext =
KeyContext() );
84 virtual bool askUserToAcceptUnsignedFile(
const std::string &file,
const KeyContext &keycontext =
KeyContext() );
92 virtual bool askUserToAcceptUnknownKey(
const std::string &file,
const std::string &
id,
const KeyContext &keycontext =
KeyContext() );
99 virtual bool askUserToAcceptVerificationFailed(
const std::string &file,
const PublicKey &key,
const KeyContext &keycontext =
KeyContext() );
117 bool askUserToAcceptPackageKey(
const PublicKey &key_r,
const KeyContext &keycontext_r =
KeyContext() );
119 constexpr
static const char * ACCEPT_PACKAGE_KEY_REQUEST =
"KeyRingReport/AcceptPackageKey";
130 void reportNonImportedKeys(
const std::set<Edition> &keys_r );
132 constexpr
static const char *KEYS_NOT_IMPORTED_REPORT =
"KeyRingReport/KeysNotImported";
147 void reportAutoImportKey(
const std::list<PublicKeyData> & keyDataList_r,
148 const PublicKeyData & keySigning_r,
151 constexpr
static const char *REPORT_AUTO_IMPORT_KEY =
"KeyRingReport/reportAutoImportKey";
187 ACCEPT_NOTHING = 0x0000,
188 ACCEPT_UNSIGNED_FILE = 0x0001,
189 ACCEPT_UNKNOWNKEY = 0x0002,
190 TRUST_KEY_TEMPORARILY = 0x0004,
191 TRUST_AND_IMPORT_KEY = 0x0008,
192 ACCEPT_VERIFICATION_FAILED = 0x0010,
197 static DefaultAccept defaultAccept();
200 static void setDefaultAccept( DefaultAccept value_r );
215 void importKey(
const PublicKey &key,
bool trusted =
false);
218 void multiKeyImport(
const Pathname & keyfile_r,
bool trusted_r =
false );
221 { dumpPublicKey(
id,
true, stream); }
224 { dumpPublicKey(
id,
false, stream); }
226 void dumpPublicKey(
const std::string &
id,
bool trusted, std::ostream &stream );
229 PublicKey exportPublicKey(
const PublicKeyData & keyData );
232 PublicKey exportTrustedPublicKey(
const PublicKeyData & keyData );
237 std::string readSignatureKeyId(
const Pathname &signature );
242 bool isKeyTrusted(
const std::string &
id );
248 bool isKeyKnown(
const std::string &
id );
254 void deleteKey(
const std::string &
id,
bool trusted =
false );
259 std::list<PublicKey> publicKeys();
264 std::list<PublicKey> trustedPublicKeys();
269 std::list<PublicKeyData> publicKeyData();
274 std::list<PublicKeyData> trustedPublicKeyData();
279 PublicKeyData publicKeyData(
const std::string &
id );
284 PublicKeyData trustedPublicKeyData(
const std::string &
id );
304 void allowPreload(
bool yesno_r );
337 #endif // ZYPP_KEYRING_H ZYPP_DECLARE_FLAGS(VendorSupportOptions, VendorSupportOption)
void dumpTrustedPublicKey(const std::string &id, std::ostream &stream)
This basically means, we knew the key, but it was not trusted.
ZYPP_DECLARE_OPERATORS_FOR_FLAGS(DiskUsageCounter::MountPoint::HintFlags)
String related utilities and Regular expression matching.
std::ostream & operator<<(std::ostream &str, const SerialNumber &obj)
std::pair< bool, zypp::keyring::VerifyFileContext > verifyFileSignature(SyncContextRef zyppContext, zypp::keyring::VerifyFileContext &&context_r)
Follows a signature verification interacting with the user.
Internal connection to rpm database.
KeyTrust
User reply options for the askUserToTrustKey callback.
void dumpUntrustedPublicKey(const std::string &id, std::ostream &stream)
const Arch Arch_armv7hnl Arch_armv7nhl ZYPP_API
DEFINE_PTR_TYPE(Application)
std::ostream & operator<<(std::ostream &str, const KeyRing &)
virtual void trustedKeyAdded(const PublicKey &)
Base class for reference counted objects.
DefaultAcceptBits
DefaultAccept flags (
RW_pointer< Impl > _pimpl
Pointer to implementation.
Callbacks from signature verification workflow.
Easy-to use interface to the ZYPP dependency resolver.
virtual void trustedKeyRemoved(const PublicKey &)
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.