diff options
author | Ingo Klöcker <[email protected]> | 2023-10-05 13:27:52 +0000 |
---|---|---|
committer | Ingo Klöcker <[email protected]> | 2023-10-05 13:27:52 +0000 |
commit | a9e5a25b56abb7f27812f333c287a7adae9e18e8 (patch) | |
tree | 263c8e9d776c005098ec4dd4c4426e2901add1aa /lang/cpp/src/key.h | |
parent | doc: Fix typo (diff) | |
download | gpgme-a9e5a25b56abb7f27812f333c287a7adae9e18e8.tar.gz gpgme-a9e5a25b56abb7f27812f333c287a7adae9e18e8.zip |
cpp: Support new key capability flags
* lang/cpp/src/key.cpp, lang/cpp/src/key.h (class Key): New methods
hasCertify, hasSign, hasEncrypt, hasAuthenticate.
--
GnuPG-bug-id: 6748
Diffstat (limited to 'lang/cpp/src/key.h')
-rw-r--r-- | lang/cpp/src/key.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lang/cpp/src/key.h b/lang/cpp/src/key.h index 9e827f63..bdcc18d2 100644 --- a/lang/cpp/src/key.h +++ b/lang/cpp/src/key.h @@ -109,14 +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; + /** 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; 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 { |