aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/model/GpgAbstractKey.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/model/GpgAbstractKey.h')
-rw-r--r--src/core/model/GpgAbstractKey.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/core/model/GpgAbstractKey.h b/src/core/model/GpgAbstractKey.h
index 854297bc..2789fa39 100644
--- a/src/core/model/GpgAbstractKey.h
+++ b/src/core/model/GpgAbstractKey.h
@@ -30,11 +30,22 @@
namespace GpgFrontend {
+enum class GpgAbstractKeyType : unsigned int {
+ kNONE = 0,
+ kGPG_KEY,
+ kGPG_SUBKEY,
+ kGPG_KEYGROUP,
+};
+
class GpgAbstractKey {
public:
[[nodiscard]] virtual auto ID() const -> QString = 0;
[[nodiscard]] virtual auto Fingerprint() const -> QString = 0;
- [[nodiscard]] virtual auto IsSubKey() const -> bool = 0;
+ [[nodiscard]] virtual auto KeyType() const -> GpgAbstractKeyType = 0;
+
+ [[nodiscard]] virtual auto Name() const -> QString = 0;
+ [[nodiscard]] virtual auto Email() const -> QString = 0;
+ [[nodiscard]] virtual auto Comment() const -> QString = 0;
[[nodiscard]] virtual auto IsPrivateKey() const -> bool = 0;
[[nodiscard]] virtual auto IsHasEncrCap() const -> bool = 0;
@@ -54,6 +65,10 @@ class GpgAbstractKey {
[[nodiscard]] auto IsPrimaryKey() const -> bool { return IsHasCertCap(); }
+ [[nodiscard]] virtual auto UID() const -> QString {
+ return QString("%1(%2)<%3>").arg(Name()).arg(Comment()).arg(Email());
+ };
+
auto operator==(const GpgAbstractKey& o) const -> bool {
return ID() == o.ID();
}