summaryrefslogtreecommitdiff
path: root/lang/cpp/src/key.h
diff options
context:
space:
mode:
Diffstat (limited to 'lang/cpp/src/key.h')
-rw-r--r--lang/cpp/src/key.h34
1 files changed, 25 insertions, 9 deletions
diff --git a/lang/cpp/src/key.h b/lang/cpp/src/key.h
index 0e6380d..bdcc18d 100644
--- a/lang/cpp/src/key.h
+++ b/lang/cpp/src/key.h
@@ -71,6 +71,7 @@ public:
static const Null null;
+ Key(const Key &other) = default;
const Key &operator=(Key other)
{
swap(other);
@@ -108,22 +109,31 @@ public:
* isDisabled || isInvalid */
bool isBad() const;
+ /** Returns true, if the key can be used for encryption (i.e. it's not bad
+ * and has an encryption subkey) or if the primary subkey can encrypt. */
bool canEncrypt() const;
- /*!
- This function contains a workaround for old gpgme's: all secret
- OpenPGP keys canSign() == true, which canReallySign() doesn't
- have. I don't have time to find what breaks when I remove this
- workaround, but since Kleopatra merges secret into public keys,
- the workaround is not necessary there (and actively harms), I've
- added a new function instead.
- */
+ /** Returns true, if the key can be used for signing (i.e. it's not bad
+ * and has a signing subkey) or if the primary subkey can sign. */
bool canSign() const;
- bool canReallySign() const;
+ GPGMEPP_DEPRECATED bool canReallySign() const;
+ /** Returns true, if the key can be used for certification (i.e. it's not bad
+ * and has a certification subkey) or if the primary subkey can certify. */
bool canCertify() const;
+ /** Returns true, if the key can be used for authentication (i.e. it's not bad
+ * and has a authentication subkey) or if the primary subkey can authenticate. */
bool canAuthenticate() const;
bool isQualified() const;
bool isDeVs() const;
+ /** Returns true, if the key has a certification subkey. */
+ bool hasCertify() const;
+ /** Returns true, if the key has a signing subkey. */
+ bool hasSign() const;
+ /** Returns true, if the key has an encryption subkey. */
+ bool hasEncrypt() const;
+ /** Returns true, if the key has an authentication subkey. */
+ bool hasAuthenticate() const;
+
bool hasSecret() const;
GPGMEPP_DEPRECATED bool isSecret() const
{
@@ -228,6 +238,7 @@ public:
Subkey(const shared_gpgme_key_t &key, gpgme_sub_key_t subkey);
Subkey(const shared_gpgme_key_t &key, unsigned int idx);
+ Subkey(const Subkey &other) = default;
const Subkey &operator=(Subkey other)
{
swap(other);
@@ -268,6 +279,9 @@ public:
bool canSign() const;
bool canCertify() const;
bool canAuthenticate() const;
+ bool canRenc() const;
+ bool canTimestamp() const;
+ bool isGroupOwned() const;
bool isQualified() const;
bool isDeVs() const;
bool isCardKey() const;
@@ -341,6 +355,7 @@ public:
UserID(const shared_gpgme_key_t &key, gpgme_user_id_t uid);
UserID(const shared_gpgme_key_t &key, unsigned int idx);
+ UserID(const UserID &other) = default;
const UserID &operator=(UserID other)
{
swap(other);
@@ -459,6 +474,7 @@ public:
Signature(const shared_gpgme_key_t &key, gpgme_user_id_t uid, gpgme_key_sig_t sig);
Signature(const shared_gpgme_key_t &key, gpgme_user_id_t uid, unsigned int idx);
+ Signature(const Signature &other) = default;
const Signature &operator=(Signature other)
{
swap(other);