aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS4
-rw-r--r--lang/cpp/src/context.cpp12
-rw-r--r--lang/cpp/src/context.h3
3 files changed, 18 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index f36be620..d10c536c 100644
--- a/NEWS
+++ b/NEWS
@@ -16,6 +16,9 @@ Noteworthy changes in version 1.18.1 (unreleased)
* cpp: Handle error when trying to sign expired keys. [T6155]
+ * cpp: Support encryption flags ThrowKeyIds, EncryptWrap, and WantAddress.
+ [T6359]
+
* cpp, qt: Fix building with C++11. [T6141]
* qt: Fix problem with expiration dates after 2038-01-19 on 32-bit systems
@@ -44,6 +47,7 @@ Noteworthy changes in version 1.18.1 (unreleased)
gpgme_op_verify_ext NEW.
cpp: GpgGenCardKeyInteractor::Curve NEW.
cpp: GpgGenCardKeyInteractor::setCurve NEW.
+ cpp: Context::WantAddress NEW.
cpp: Data::setFileName EXTENDED: New overload
qt: ListAllKeysJob::Option NEW.
qt: ListAllKeysJob::Options NEW.
diff --git a/lang/cpp/src/context.cpp b/lang/cpp/src/context.cpp
index 68b061db..f93887f5 100644
--- a/lang/cpp/src/context.cpp
+++ b/lang/cpp/src/context.cpp
@@ -1343,6 +1343,15 @@ static gpgme_encrypt_flags_t encryptflags2encryptflags(Context::EncryptionFlags
if (flags & Context::Symmetric) {
result |= GPGME_ENCRYPT_SYMMETRIC;
}
+ if (flags & Context::ThrowKeyIds) {
+ result |= GPGME_ENCRYPT_THROW_KEYIDS;
+ }
+ if (flags & Context::EncryptWrap) {
+ result |= GPGME_ENCRYPT_WRAP;
+ }
+ if (flags & Context::WantAddress) {
+ result |= GPGME_ENCRYPT_WANT_ADDRESS;
+ }
if (flags & Context::EncryptArchive) {
result |= GPGME_ENCRYPT_ARCHIVE;
}
@@ -1916,6 +1925,9 @@ std::ostream &operator<<(std::ostream &os, Context::EncryptionFlags flags)
CHECK(ExpectSign);
CHECK(NoCompress);
CHECK(Symmetric);
+ CHECK(ThrowKeyIds);
+ CHECK(EncryptWrap);
+ CHECK(WantAddress);
CHECK(EncryptArchive);
#undef CHECK
return os << ')';
diff --git a/lang/cpp/src/context.h b/lang/cpp/src/context.h
index b38e8cdf..d66344ce 100644
--- a/lang/cpp/src/context.h
+++ b/lang/cpp/src/context.h
@@ -448,7 +448,8 @@ public:
Symmetric = 32,
ThrowKeyIds = 64,
EncryptWrap = 128,
- EncryptArchive = 512,
+ WantAddress = 256,
+ EncryptArchive = 512
};
EncryptionResult encrypt(const std::vector<Key> &recipients, const Data &plainText, Data &cipherText, EncryptionFlags flags);
GpgME::Error encryptSymmetrically(const Data &plainText, Data &cipherText);