Skip to content

Commit

Permalink
Add names as string to the keystore classes
Browse files Browse the repository at this point in the history
Allow checking which one is selected by name.
  • Loading branch information
ffesti committed Dec 13, 2024
1 parent fc89966 commit 3ebd9be
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/keystore.hh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace rpm {

class keystore {
public:
virtual std::string get_name() { return "None"; };
virtual rpmRC load_keys(rpmtxn txn, rpmKeyring keyring) = 0;
virtual rpmRC import_key(rpmtxn txn, rpmPubkey key, int replace = 1, rpmFlags flags = 0) = 0;
virtual rpmRC delete_key(rpmtxn txn, rpmPubkey key) = 0;
Expand All @@ -19,6 +20,7 @@ public:

class keystore_fs : public keystore {
public:
virtual std::string get_name() { return "fs"; };
virtual rpmRC load_keys(rpmtxn txn, rpmKeyring keyring);
virtual rpmRC import_key(rpmtxn txn, rpmPubkey key, int replace = 1, rpmFlags flags = 0);
virtual rpmRC delete_key(rpmtxn txn, rpmPubkey key);
Expand All @@ -29,6 +31,7 @@ private:

class keystore_rpmdb : public keystore {
public:
virtual std::string get_name() { return "rpmdb"; };
virtual rpmRC load_keys(rpmtxn txn, rpmKeyring keyring);
virtual rpmRC import_key(rpmtxn txn, rpmPubkey key, int replace = 1, rpmFlags flags = 0);
virtual rpmRC delete_key(rpmtxn txn, rpmPubkey key);
Expand All @@ -39,6 +42,7 @@ private:

class keystore_openpgp_cert_d : public keystore {
public:
virtual std::string get_name() { return "openpgp"; };
virtual rpmRC load_keys(rpmtxn txn, rpmKeyring keyring);
virtual rpmRC import_key(rpmtxn txn, rpmPubkey key, int replace = 1, rpmFlags flags = 0);
virtual rpmRC delete_key(rpmtxn txn, rpmPubkey key);
Expand Down

0 comments on commit 3ebd9be

Please sign in to comment.