aboutsummaryrefslogtreecommitdiffstats
path: root/lang/cpp
diff options
context:
space:
mode:
authorAndre Heinecke <[email protected]>2018-05-22 10:08:01 +0000
committerAndre Heinecke <[email protected]>2018-05-22 10:08:01 +0000
commit28e3778ce21069006153bc156a414de6d9347962 (patch)
tree9a416bca195e7cf2b5d4436230c7b189144b367c /lang/cpp
parentcore, w32: Add w64 handling for regkeys (diff)
downloadgpgme-28e3778ce21069006153bc156a414de6d9347962.tar.gz
gpgme-28e3778ce21069006153bc156a414de6d9347962.zip
cpp: Expose sessionKey and symkeyAlgo
* lang/cpp/decryptionresult.cpp, lang/cpp/decryptionresult.h (DecryptionResult::symkeyAlgo, DecryptionResult::sessionKey): New.
Diffstat (limited to 'lang/cpp')
-rw-r--r--lang/cpp/src/decryptionresult.cpp11
-rw-r--r--lang/cpp/src/decryptionresult.h4
2 files changed, 15 insertions, 0 deletions
diff --git a/lang/cpp/src/decryptionresult.cpp b/lang/cpp/src/decryptionresult.cpp
index 1e815cbe..17524db9 100644
--- a/lang/cpp/src/decryptionresult.cpp
+++ b/lang/cpp/src/decryptionresult.cpp
@@ -155,6 +155,16 @@ std::vector<GpgME::DecryptionResult::Recipient> GpgME::DecryptionResult::recipie
return result;
}
+const char *GpgME::DecryptionResult::sessionKey() const
+{
+ return d ? d->res.session_key : nullptr;
+}
+
+const char *GpgME::DecryptionResult::symkeyAlgo() const
+{
+ return d ? d->res.symkey_algo : nullptr;
+}
+
class GpgME::DecryptionResult::Recipient::Private : public _gpgme_recipient
{
public:
@@ -231,6 +241,7 @@ std::ostream &GpgME::operator<<(std::ostream &os, const DecryptionResult &result
<< "\n unsupportedAlgorithm: " << protect(result.unsupportedAlgorithm())
<< "\n isWrongKeyUsage: " << result.isWrongKeyUsage()
<< "\n isDeVs " << result.isDeVs()
+ << "\n symkeyAlgo: " << protect(result.symkeyAlgo())
<< "\n recipients:\n";
const std::vector<DecryptionResult::Recipient> recipients = result.recipients();
std::copy(recipients.begin(), recipients.end(),
diff --git a/lang/cpp/src/decryptionresult.h b/lang/cpp/src/decryptionresult.h
index 57705b48..c270223d 100644
--- a/lang/cpp/src/decryptionresult.h
+++ b/lang/cpp/src/decryptionresult.h
@@ -77,6 +77,10 @@ public:
const char *fileName() const;
+ const char *sessionKey() const;
+
+ const char *symkeyAlgo() const;
+
class Recipient;
unsigned int numRecipients() const;