summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIngo Klöcker <dev@ingo-kloecker.de>2023-01-27 09:40:05 +0100
committerIngo Klöcker <dev@ingo-kloecker.de>2023-01-27 12:16:02 +0100
commitd28ea8c6b3db008150e2bae99a33e30b55c4bc10 (patch)
tree284470de124702bf6478bd165a13d56eed7d125c
parent261245a2e0e76568607c79a0c80372cb6f46444e (diff)
downloadgpgme-d28ea8c6b3db008150e2bae99a33e30b55c4bc10.tar.gz
cpp: Support new archive encryption flag
* lang/cpp/src/context.h (EncryptArchive): New flag. * lang/cpp/src/context.cpp (encryptflags2encryptflags): Convert EncryptArchive to corresponding gpgme encrypt flags. (operator<<): Add new flag to debug stream. -- GnuPG-bug-id: 6342
-rw-r--r--lang/cpp/src/context.cpp4
-rw-r--r--lang/cpp/src/context.h3
2 files changed, 6 insertions, 1 deletions
diff --git a/lang/cpp/src/context.cpp b/lang/cpp/src/context.cpp
index dba958cf..f7f6f54d 100644
--- a/lang/cpp/src/context.cpp
+++ b/lang/cpp/src/context.cpp
@@ -1335,6 +1335,9 @@ static gpgme_encrypt_flags_t encryptflags2encryptflags(Context::EncryptionFlags
if (flags & Context::Symmetric) {
result |= GPGME_ENCRYPT_SYMMETRIC;
}
+ if (flags & Context::EncryptArchive) {
+ result |= GPGME_ENCRYPT_ARCHIVE;
+ }
return static_cast<gpgme_encrypt_flags_t>(result);
}
@@ -1909,6 +1912,7 @@ std::ostream &operator<<(std::ostream &os, Context::EncryptionFlags flags)
CHECK(ExpectSign);
CHECK(NoCompress);
CHECK(Symmetric);
+ CHECK(EncryptArchive);
#undef CHECK
return os << ')';
}
diff --git a/lang/cpp/src/context.h b/lang/cpp/src/context.h
index 7bd1b03d..b38e8cdf 100644
--- a/lang/cpp/src/context.h
+++ b/lang/cpp/src/context.h
@@ -447,7 +447,8 @@ public:
NoCompress = 16,
Symmetric = 32,
ThrowKeyIds = 64,
- EncryptWrap = 128
+ EncryptWrap = 128,
+ EncryptArchive = 512,
};
EncryptionResult encrypt(const std::vector<Key> &recipients, const Data &plainText, Data &cipherText, EncryptionFlags flags);
GpgME::Error encryptSymmetrically(const Data &plainText, Data &cipherText);