[Pkg-gnupg-commit] [gpgme] 202/412: Cpp: Add PubkeyAlgo enum
Daniel Kahn Gillmor
dkg at fifthhorseman.net
Thu Sep 22 21:26:47 UTC 2016
This is an automated email from the git hooks/post-receive script.
dkg pushed a commit to branch master
in repository gpgme.
commit c28007d0407bcc3621b8266d6d77eb0d069aec35
Author: Andre Heinecke <aheinecke at intevation.de>
Date: Wed Jul 6 13:38:20 2016 +0200
Cpp: Add PubkeyAlgo enum
* lang/cpp/src/key.h (Subkey::PubkeyAlgo): New enum.
(Subkey::publicKeyAlgorithm): Change return type.
* lang/cpp/src/key.cpp (Subkey::publicKeyAlgorithm): Use enum.
---
lang/cpp/src/key.cpp | 4 ++--
lang/cpp/src/key.h | 18 +++++++++++++++++-
2 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/lang/cpp/src/key.cpp b/lang/cpp/src/key.cpp
index 55eb058..9e57013 100644
--- a/lang/cpp/src/key.cpp
+++ b/lang/cpp/src/key.cpp
@@ -373,9 +373,9 @@ const char *Subkey::fingerprint() const
return subkey ? subkey->fpr : 0 ;
}
-unsigned int Subkey::publicKeyAlgorithm() const
+Subkey::PubkeyAlgo Subkey::publicKeyAlgorithm() const
{
- return subkey ? subkey->pubkey_algo : 0 ;
+ return subkey ? static_cast<PubkeyAlgo>(subkey->pubkey_algo) : AlgoUnknown;
}
const char *Subkey::publicKeyAlgorithmAsString() const
diff --git a/lang/cpp/src/key.h b/lang/cpp/src/key.h
index 7322f65..845b5db 100644
--- a/lang/cpp/src/key.h
+++ b/lang/cpp/src/key.h
@@ -205,7 +205,23 @@ public:
bool isSecret() const;
- unsigned int publicKeyAlgorithm() const;
+ /** Same as gpgme_pubkey_algo_t */
+ enum PubkeyAlgo {
+ AlgoUnknown = 0,
+ AlgoRSA = 1,
+ AlgoRSA_E = 2,
+ AlgoRSA_S = 3,
+ AlgoELG_E = 16,
+ AlgoDSA = 17,
+ AlgoECC = 18,
+ AlgoELG = 20,
+ AlgoECDSA = 301,
+ AlgoECDH = 302,
+ AlgoEDDSA = 303,
+ AlgoMax = 1 << 31
+ };
+
+ PubkeyAlgo publicKeyAlgorithm() const;
/**
@brief Get the public key algorithm name.
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gpgme.git
More information about the Pkg-gnupg-commit
mailing list