Compare commits
123 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
5c095553e4 | ||
|
9ab2ce36f9 | ||
|
c69240c843 | ||
|
42e151b34b | ||
|
e6830b58b6 | ||
|
899a572b33 | ||
|
69558f2c0b | ||
|
576d2db9dd | ||
|
aa15a664b3 | ||
|
e46748a0d1 | ||
|
f6d020e24f | ||
|
28542b14c4 | ||
|
2656d3ee5b | ||
|
acf574af64 | ||
|
b7435b31f6 | ||
|
95bd4fa813 | ||
|
de60684500 | ||
|
8b4171680c | ||
|
9c276e762a | ||
|
ec2c6dd8bc | ||
|
6ed5c9a38a | ||
|
7d5df0bf0d | ||
|
09827ffc77 | ||
|
53c367629a | ||
|
c52e1943a7 | ||
|
60b96d149c | ||
|
6c90ec7be2 | ||
|
14b035034a | ||
|
2187a4de8c | ||
|
5b73b0722a | ||
|
3b9815bd8a | ||
|
307256d277 | ||
|
87319b3fc7 | ||
|
29be63ae37 | ||
|
09cc0c81f7 | ||
|
967b6b726e | ||
|
4136928f0d | ||
|
5d9269cb4f | ||
|
25dd284b0c | ||
|
1245b09012 | ||
|
09d81da665 | ||
|
5844d9e700 | ||
|
986c5f0b94 | ||
|
6aa359b1e8 | ||
|
f0d1f2c4c7 | ||
|
15718cb295 | ||
|
e42b72bc2b | ||
|
90eb80134b | ||
|
f2575b6313 | ||
|
adadfac997 | ||
|
ac4bf86bb6 | ||
|
55a1ae4163 | ||
|
c933269d3a | ||
|
333241b286 | ||
|
73403a8ba0 | ||
|
0f5e8182e7 | ||
|
3e3db5784f | ||
|
87061c0260 | ||
|
a73a41109f | ||
|
06db03ea9b | ||
|
882ccc8ea7 | ||
|
e4a95746ad | ||
|
67057d83f5 | ||
|
7158397c09 | ||
|
47f3d92bf3 | ||
|
0011412193 | ||
|
eae22d9a48 | ||
|
cc1f2b5acb | ||
|
e3ae88267f | ||
|
18388f93ab | ||
|
b37efb11be | ||
|
85c7a94d63 | ||
|
7e520213c0 | ||
|
d60d1b7f79 | ||
|
18a0d72b1b | ||
|
c631622484 | ||
|
1dc44b7c5b | ||
|
0b3c8709f7 | ||
|
e77a8ac0cc | ||
|
20b32e0350 | ||
|
a44d84772d | ||
|
b166958b86 | ||
|
60c0fd7c95 | ||
|
5efd3486a9 | ||
|
963ace1f9f | ||
|
0221d7f28a | ||
|
b35bcf0040 | ||
|
d5dafb2ae3 | ||
|
f7d69de030 | ||
|
6baccdc0c3 | ||
|
f212de4a9e | ||
|
1a26db7175 | ||
|
1bbe2d4b70 | ||
|
618fea9e20 | ||
|
278f92b189 | ||
|
185ab7d7ba | ||
|
77e982579c | ||
|
1bfd5e92d0 | ||
|
52d59d75ca | ||
|
ae332749ee | ||
|
cf88690cf4 | ||
|
46f5d5eeb3 | ||
|
8d8985bda1 | ||
|
0a0a5906d5 | ||
|
cadcb38469 | ||
|
a0a4cd411c | ||
|
8faaf7b72b | ||
|
aae967ec9c | ||
|
ab25df8328 | ||
|
5c7e4d252a | ||
|
131384b107 | ||
|
bd448c9cbf | ||
|
57205c1dfa | ||
|
959f976dfc | ||
|
a9e5a25b56 | ||
|
0132a1089f | ||
|
b63d203d3b | ||
|
349a69b5ea | ||
|
8ad22290df | ||
|
d43d787e9a | ||
|
4e321a0f06 | ||
|
927f129663 | ||
|
3e64856208 |
154
NEWS
154
NEWS
@ -1,17 +1,163 @@
|
||||
Noteworthy changes in version 1.23.0 (unreleased)
|
||||
Noteworthy changes in version 1.24.0 (unrelease)
|
||||
-------------------------------------------------
|
||||
|
||||
* Extended gpgme_op_decrypt* and gpgme_op_verify* to allow writing the
|
||||
output directly to a file. [T6550]
|
||||
|
||||
* Extended gpgme_op_encrypt*, gpgme_op_encrypt_sign*, and gpgme_op_sign*
|
||||
to allow reading the input data directly from a file. [T6550]
|
||||
|
||||
* Add information about designated revocation keys. [T7118]
|
||||
|
||||
* New context flag "import-options". [T7152]
|
||||
|
||||
* cpp: Provide information about designated revocation keys for a Key.
|
||||
[T7118]
|
||||
|
||||
* cpp: Add safer member function returning text describing an error.
|
||||
[T5960]
|
||||
|
||||
* qt: Build QGpgME for Qt 5 and Qt 6 simultaneously. [T7205]
|
||||
|
||||
* qt: Install headers for Qt 5 and Qt 6 in separate folders. [T7161]
|
||||
|
||||
* qt: Allow reading the data to decrypt/encrypt/sign/verify directly from
|
||||
files. [T6550]
|
||||
|
||||
* qt: Allow writing the decrypted/encrypted/signed/verified data directly
|
||||
to files. [T6550]
|
||||
|
||||
* qt: Allow specifying import options when importing keys. [T7152]
|
||||
|
||||
* qt: Allow appending a detached signature to an existing file. [T6867]
|
||||
|
||||
* Interface changes relative to the 1.23.2 release:
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
GPGME_ENCRYPT_FILE NEW.
|
||||
GPGME_SIG_MODE_FILE NEW.
|
||||
gpgme_key_t EXTENDED: New field 'revkeys'.
|
||||
gpgme_revocation_key_t NEW.
|
||||
gpgme_set_ctx_flag EXTENDED: New flag 'import-options'.
|
||||
cpp: Context::EncryptFile NEW.
|
||||
cpp: SignatureMode::SignFile NEW.
|
||||
cpp: RevocationKey NEW.
|
||||
cpp: Key::revocationKey NEW.
|
||||
cpp: Key::numRevocationKeys NEW.
|
||||
cpp: Key::revocationKeys NEW.
|
||||
cpp: Error::asStdString NEW.
|
||||
cpp: Error::asString DEPRECATED.
|
||||
qt: DecryptVerifyJob::setInputFile NEW.
|
||||
qt: DecryptVerifyJob::inputFile NEW.
|
||||
qt: DecryptVerifyJob::setOutputFile NEW.
|
||||
qt: DecryptVerifyJob::outputFile NEW.
|
||||
qt: EncryptJob::setRecipients NEW.
|
||||
qt: EncryptJob::recipients NEW.
|
||||
qt: EncryptJob::setInputFile NEW.
|
||||
qt: EncryptJob::inputFile NEW.
|
||||
qt: EncryptJob::setOutputFile NEW.
|
||||
qt: EncryptJob::outputFile NEW.
|
||||
qt: EncryptJob::setEncryptionFlags NEW.
|
||||
qt: EncryptJob::encryptionFlags NEW.
|
||||
qt: SignEncryptJob::setSigners NEW.
|
||||
qt: SignEncryptJob::signers NEW.
|
||||
qt: SignEncryptJob::setRecipients NEW.
|
||||
qt: SignEncryptJob::recipients NEW.
|
||||
qt: SignEncryptJob::setInputFile NEW.
|
||||
qt: SignEncryptJob::inputFile NEW.
|
||||
qt: SignEncryptJob::setOutputFile NEW.
|
||||
qt: SignEncryptJob::outputFile NEW.
|
||||
qt: SignEncryptJob::setEncryptionFlags NEW.
|
||||
qt: SignEncryptJob::encryptionFlags NEW.
|
||||
qt: SignJob::setSigners NEW.
|
||||
qt: SignJob::signers NEW.
|
||||
qt: SignJob::setInputFile NEW.
|
||||
qt: SignJob::inputFile NEW.
|
||||
qt: SignJob::setOutputFile NEW.
|
||||
qt: SignJob::outputFile NEW.
|
||||
qt: SignJob::setSigningFlags NEW.
|
||||
qt: SignJob::signingFlags NEW.
|
||||
qt: SignJob::setAppendSignature NEW.
|
||||
qt: SignJob::appendSignatureEnabled NEW.
|
||||
qt: VerifyDetachedJob::setSignatureFile NEW.
|
||||
qt: VerifyDetachedJob::signatureFile NEW.
|
||||
qt: VerifyDetachedJob::setSignedFile NEW.
|
||||
qt: VerifyDetachedJob::signedFile NEW.
|
||||
qt: VerifyOpaqueJob::setInputFile NEW.
|
||||
qt: VerifyOpaqueJob::inputFile NEW.
|
||||
qt: VerifyOpaqueJob::setOutputFile NEW.
|
||||
qt: VerifyOpaqueJob::outputFile NEW.
|
||||
qt: ImportJob::setImportOptions NEW.
|
||||
qt: ImportJob::importOptions NEW.
|
||||
|
||||
|
||||
Noteworthy changes in version 1.23.2 (2023-11-28)
|
||||
-------------------------------------------------
|
||||
|
||||
* Preserve more specific existing failure code. [T6575]
|
||||
|
||||
* qt: Start dirmngr with gpgconf to avoid multiple instances. [T6833]
|
||||
|
||||
* qt: On Windows, use UTF-8 when logging the error text. [T5960]
|
||||
|
||||
* qt: Remove left-over partial files more persistently. [T6584]
|
||||
|
||||
* qt: Use a temporary file name when creating signed or encrypted
|
||||
archives. [T6721]
|
||||
|
||||
* qt: Build Qt 6 bindings with -fPIC if requested or Qt 6 was built with
|
||||
this flag. [T6781]
|
||||
|
||||
Notes:
|
||||
~~~~~~
|
||||
qt: DefaultKeyGenerationJob DEPRECATED.
|
||||
|
||||
[c=C43/A32/R1 cpp=C26/A20/R1 qt=C20/A5/R1]
|
||||
|
||||
Release-info: https://dev.gnupg.org/T6782
|
||||
|
||||
|
||||
Noteworthy changes in version 1.23.1 (2023-10-27)
|
||||
-------------------------------------------------
|
||||
|
||||
* w32: Change gpgme-w32-spawn to use Unicode arguments. [T6728]
|
||||
|
||||
[c=C43/A32/R0 cpp=C26/A20/R0 qt=C20/A5/R0]
|
||||
|
||||
Release-info: https://dev.gnupg.org/T6774
|
||||
|
||||
|
||||
Noteworthy changes in version 1.23.0 (2023-10-25)
|
||||
-------------------------------------------------
|
||||
|
||||
* Support GPGME_ENCRYPT_ALWAYS_TRUST also for S/MIME. [T6559]
|
||||
|
||||
* New keylist mode GPGME_KEYLIST_MODE_WITH_V5FPR. [T6705]
|
||||
|
||||
* New key capability flags has_*. [T6748]
|
||||
|
||||
* gpgme-tool: Support use of Windows HANDLE. [T6634]
|
||||
|
||||
* qt: Support refreshing keys via WKD. [T6672]
|
||||
|
||||
* qt: Handle cancel in changeexpiryjob. [T6754]
|
||||
|
||||
* Interface changes relative to the 1.22.0 release:
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
GPGME_KEYLIST_MODE_WITH_V5FPR NEW.
|
||||
qt: Protocol::wkdRefreshJob NEW.
|
||||
qt: WKDRefreshJob NEW.
|
||||
GPGME_KEYLIST_MODE_WITH_V5FPR NEW.
|
||||
gpgme_key_t EXTENDED: New field has_encrypt.
|
||||
gpgme_key_t EXTENDED: New field has_sign.
|
||||
gpgme_key_t EXTENDED: New field has_certify.
|
||||
gpgme_key_t EXTENDED: New field has_authenticate.
|
||||
cpp: Key::canCertify NEW.
|
||||
cpp: Key::canSign NEW.
|
||||
cpp: Key::canEncrypt NEW.
|
||||
cpp: Key::canAuthenticate NEW.
|
||||
qt: Protocol::wkdRefreshJob NEW.
|
||||
qt: WKDRefreshJob NEW.
|
||||
|
||||
[c=C43/A32/R0 cpp=C26/A20/R0 qt=C20/A5/R0]
|
||||
|
||||
Release-info: https://dev.gnupg.org/T6774
|
||||
|
||||
|
||||
Noteworthy changes in version 1.22.0 (2023-08-21)
|
||||
|
6
README
6
README
@ -41,11 +41,11 @@ See the file INSTALL for generic installation instructions.
|
||||
Check that you have unmodified sources. See below on how to do this.
|
||||
Don't skip it - this is an important step!
|
||||
|
||||
To build GPGME, you need to install libgpg-error (>= 1.24) and
|
||||
To build GPGME, you need to install libgpg-error (>= 1.36) and
|
||||
Libassuan (>= 2.4.2).
|
||||
|
||||
For support of the OpenPGP and the CMS protocols, you should use the
|
||||
latest version of GnuPG (>= 2.1.18) , available at:
|
||||
For support of the OpenPGP and the CMS protocols, you should use at
|
||||
least GnuPG version 2.2.41 or 2.4.3, available at:
|
||||
https://gnupg.org/ftp/gcrypt/gnupg/.
|
||||
|
||||
For building the Git version of GPGME please see the file README.GIT
|
||||
|
@ -482,7 +482,7 @@
|
||||
% \def\foo{\parsearg\Xfoo}
|
||||
% \def\Xfoo#1{...}
|
||||
%
|
||||
% Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my
|
||||
% Actually, I use \csname\string\foo\endcsname, i.e. \\foo, as it is my
|
||||
% favourite TeX trick. --kasal, 16nov03
|
||||
|
||||
\def\parseargdef#1{%
|
||||
|
164
configure.ac
164
configure.ac
@ -31,7 +31,7 @@ min_automake_version="1.14"
|
||||
# for the LT versions.
|
||||
m4_define([mym4_package],[gpgme])
|
||||
m4_define([mym4_major], [1])
|
||||
m4_define([mym4_minor], [23])
|
||||
m4_define([mym4_minor], [24])
|
||||
m4_define([mym4_micro], [0])
|
||||
|
||||
# Below is m4 magic to extract and compute the git revision number,
|
||||
@ -53,20 +53,20 @@ AC_INIT([mym4_package],[mym4_version],[https://bugs.gnupg.org])
|
||||
# (Interfaces added: AGE++)
|
||||
# (Interfaces removed: AGE=0)
|
||||
#
|
||||
LIBGPGME_LT_CURRENT=42
|
||||
LIBGPGME_LT_AGE=31
|
||||
LIBGPGME_LT_REVISION=0
|
||||
LIBGPGME_LT_CURRENT=43
|
||||
LIBGPGME_LT_AGE=32
|
||||
LIBGPGME_LT_REVISION=1
|
||||
|
||||
# If there is an ABI break in gpgmepp or qgpgme also bump the
|
||||
# version in IMPORTED_LOCATION in the GpgmeppConfig-w32.cmake.in.in
|
||||
|
||||
LIBGPGMEPP_LT_CURRENT=25
|
||||
LIBGPGMEPP_LT_AGE=19
|
||||
LIBGPGMEPP_LT_REVISION=0
|
||||
LIBGPGMEPP_LT_CURRENT=26
|
||||
LIBGPGMEPP_LT_AGE=20
|
||||
LIBGPGMEPP_LT_REVISION=1
|
||||
|
||||
LIBQGPGME_LT_CURRENT=19
|
||||
LIBQGPGME_LT_AGE=4
|
||||
LIBQGPGME_LT_REVISION=0
|
||||
LIBQGPGME_LT_CURRENT=20
|
||||
LIBQGPGME_LT_AGE=5
|
||||
LIBQGPGME_LT_REVISION=1
|
||||
################################################
|
||||
|
||||
AC_SUBST(LIBGPGME_LT_CURRENT)
|
||||
@ -85,7 +85,7 @@ AC_SUBST(LIBQGPGME_LT_REVISION)
|
||||
GPGME_CONFIG_API_VERSION=1
|
||||
##############################################
|
||||
|
||||
NEED_GPG_ERROR_VERSION=1.36
|
||||
NEED_GPG_ERROR_VERSION=1.47
|
||||
NEED_LIBASSUAN_API=2
|
||||
NEED_LIBASSUAN_VERSION=2.4.2
|
||||
|
||||
@ -257,7 +257,7 @@ have_macos_system=no
|
||||
build_w32_glib=no
|
||||
build_w32_qt=no
|
||||
available_languages="cl cpp python qt qt5 qt6"
|
||||
default_languages="cl cpp python qt"
|
||||
default_languages="cl cpp python qt5 qt6"
|
||||
case "${host}" in
|
||||
x86_64-*mingw32*)
|
||||
have_w64_system=yes
|
||||
@ -338,14 +338,44 @@ if test x$fixed_search_path != x ; then
|
||||
[Locate binaries only via this PATH])
|
||||
fi
|
||||
|
||||
# Option --enable-reduce-relocations
|
||||
#
|
||||
# Allow building the Qt 6 bindings explicitly with -fPIC if the automatic
|
||||
# detection fails. Note: We assume that this flag is always available (unless
|
||||
# we built for Windows).
|
||||
AC_ARG_ENABLE([reduce-relocations],
|
||||
AS_HELP_STRING([--enable-reduce-relocations],
|
||||
[build Qt 6 bindings with -fPIC (default is
|
||||
auto)]),
|
||||
[use_reduce_relocations="$enableval"],
|
||||
[use_reduce_relocations=""])
|
||||
|
||||
# Option --enable-no-direct-extern-access
|
||||
#
|
||||
# Some distributions build Qt 6 with -mno-direct-extern-access. Libraries and
|
||||
# applications using Qt then must also be build with this flag. As workaround
|
||||
# for a bug in Qt's pkgconfig files which don't have this flag we allow
|
||||
# building with this flag explicitly.
|
||||
AC_LANG_PUSH(C++)
|
||||
AX_CHECK_COMPILE_FLAG([-mno-direct-extern-access],
|
||||
[have_no_direct_extern_access="yes"],
|
||||
[have_no_direct_extern_access="no"],
|
||||
[-Werror])
|
||||
AC_LANG_POP()
|
||||
AC_ARG_ENABLE([no-direct-extern-access],
|
||||
AS_HELP_STRING([--enable-no-direct-extern-access],
|
||||
[build Qt 6 bindings with
|
||||
-mno-direct-extern-access (default is auto)]),
|
||||
[use_no_direct_extern_access="$enableval"],
|
||||
[use_no_direct_extern_access=""])
|
||||
|
||||
|
||||
# Note: You need to declare all possible languages also in
|
||||
# lang/Makefile.am's DIST_SUBDIRS.
|
||||
AC_ARG_ENABLE([languages],
|
||||
AS_HELP_STRING([--enable-languages=languages],
|
||||
[enable only specific language bindings:
|
||||
cl cpp python qt qt5 qt6 (qt selects qt5 or qt6,
|
||||
and qt5 and qt6 exclude each other)]),
|
||||
cl cpp python qt5 qt6]),
|
||||
[enabled_languages=`echo $enableval | \
|
||||
tr ',:' ' ' | tr '[A-Z]' '[a-z]' | \
|
||||
sed 's/c++/cpp/'`],
|
||||
@ -371,76 +401,95 @@ for language in $enabled_languages; do
|
||||
fi
|
||||
done
|
||||
|
||||
# Check whether Qt5 and/or Qt6 are enabled explicitly
|
||||
want_qt5="no";
|
||||
# Check whether qt5 and/or qt6 are enabled
|
||||
want_qt5="no"
|
||||
LIST_MEMBER("qt5", $enabled_languages)
|
||||
if test "$found" = "1"; then
|
||||
want_qt5="yes";
|
||||
if test "$explicit_languages" = "1"; then
|
||||
want_qt5="yes"
|
||||
else
|
||||
want_qt5="maybe"
|
||||
fi
|
||||
# Remove qt5; further down qt will be added
|
||||
enabled_languages=$(echo $enabled_languages | sed 's/qt5//')
|
||||
fi
|
||||
want_qt6="no";
|
||||
want_qt6="no"
|
||||
LIST_MEMBER("qt6", $enabled_languages)
|
||||
if test "$found" = "1"; then
|
||||
want_qt6="yes";
|
||||
if test "$explicit_languages" = "1"; then
|
||||
want_qt6="yes"
|
||||
else
|
||||
want_qt6="maybe"
|
||||
fi
|
||||
# Remove qt6; further down qt will be added
|
||||
enabled_languages=$(echo $enabled_languages | sed 's/qt6//')
|
||||
fi
|
||||
if test "$want_qt5" = "yes" -a "$want_qt6" = "yes"; then
|
||||
AC_MSG_ERROR([[
|
||||
|
||||
# Check whether qt is enabled; if yes then it has been enabled explicitly
|
||||
want_qt="no"
|
||||
LIST_MEMBER("qt", $enabled_languages)
|
||||
if test "$found" = "1"; then
|
||||
# Ignore qt if specified together with qt5 or qt6
|
||||
if test "$want_qt5" = "no" -a "$want_qt6" = "no"; then
|
||||
want_qt="yes"
|
||||
fi
|
||||
# Remove qt
|
||||
enabled_languages=$(echo $enabled_languages | sed 's/qt//')
|
||||
AC_MSG_WARN([[
|
||||
***
|
||||
*** The bindings for Qt5 and Qt6 cannot be built simultaneously.
|
||||
*** Language binding "qt" is deprecated and will be removed in a future version.
|
||||
*** Use "qt5" and/or "qt6" instead.
|
||||
***]])
|
||||
fi
|
||||
|
||||
# Ensure that pkg-config is available for all calls of FIND_QT5/FIND_QT6
|
||||
PKG_PROG_PKG_CONFIG
|
||||
|
||||
# If the generic qt is enabled, then check for Qt5 or Qt6 (in this order)
|
||||
LIST_MEMBER("qt", $enabled_languages)
|
||||
if test "$found" = "1"; then
|
||||
# Remove the generic qt (qt5 and qt6 have already been removed)
|
||||
enabled_languages=$(echo $enabled_languages | sed 's/qt//')
|
||||
# Check for Qt 5 (if qt5 or qt is enabled)
|
||||
if test "$want_qt" = "yes"; then
|
||||
want_qt5="maybe"
|
||||
fi
|
||||
if test "$want_qt5" != "no"; then
|
||||
FIND_QT5
|
||||
if test "$have_qt5_libs" = "yes"; then
|
||||
want_qt5="yes";
|
||||
else
|
||||
FIND_QT6
|
||||
if test "$have_qt6_libs" = "yes"; then
|
||||
want_qt6="yes";
|
||||
else
|
||||
if test "$explicit_languages" = "1"; then
|
||||
AC_MSG_ERROR([[
|
||||
***
|
||||
*** Qt5 (Qt5Core) or Qt6 (Qt6Core) is required for the Qt binding.
|
||||
***]])
|
||||
else
|
||||
AC_MSG_WARN([[
|
||||
***
|
||||
*** Qt5 (Qt5Core) and Qt6 (Qt6Core) not found. Qt Binding will be disabled.
|
||||
***]])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
elif test "$want_qt5" = "yes"; then
|
||||
FIND_QT5
|
||||
if test "$have_qt5_libs" != "yes"; then
|
||||
want_qt5="yes"
|
||||
elif test "$want_qt5" = "yes"; then
|
||||
AC_MSG_ERROR([[
|
||||
***
|
||||
*** Qt5 (Qt5Core) is required for the Qt 5 binding.
|
||||
***]])
|
||||
else
|
||||
want_qt5="no"
|
||||
fi
|
||||
elif test "$want_qt6" = "yes"; then
|
||||
fi
|
||||
|
||||
# Check for Qt 6 (if qt6 is enabled or if qt is enabled and Qt 5 wasn't found)
|
||||
if test "$want_qt" = "yes" -a "$have_qt5_libs" != "yes"; then
|
||||
want_qt6="maybe"
|
||||
fi
|
||||
if test "$want_qt6" != "no"; then
|
||||
FIND_QT6
|
||||
if test "$have_qt6_libs" != "yes"; then
|
||||
if test "$have_qt6_libs" = "yes"; then
|
||||
want_qt6="yes";
|
||||
elif test "$want_qt6" = "yes"; then
|
||||
AC_MSG_ERROR([[
|
||||
***
|
||||
*** Qt6 (Qt6Core) is required for the Qt 6 binding.
|
||||
***]])
|
||||
else
|
||||
want_qt6="no"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check that cpp is enabled if qt5 or qt6 is enabled
|
||||
# Check if any Qt was found (if qt is enabled)
|
||||
if test "$want_qt" = "yes" -a "$have_qt5_libs" != "yes" -a "$have_qt6_libs" != "yes"; then
|
||||
AC_MSG_ERROR([[
|
||||
***
|
||||
*** Qt5 (Qt5Core) or Qt6 (Qt6Core) is required for the Qt bindings.
|
||||
***]])
|
||||
fi
|
||||
|
||||
# Check that cpp is enabled if qt5 or qt6 is enabled and was found
|
||||
if test "$want_qt5" = "yes" -o "$want_qt6" = "yes"; then
|
||||
LIST_MEMBER("cpp", $enabled_languages)
|
||||
if test "$found" = "0"; then
|
||||
@ -491,7 +540,7 @@ if test "$found" = "1" -a "$HAVE_CXX17" != "1"; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# Now append qt to the list of language bindings
|
||||
# Now append qt to the list of language bindings (to enable the subdir in lang)
|
||||
if test "$want_qt5" = "yes" -o "$want_qt6" = "yes"; then
|
||||
enabled_languages=$(echo $enabled_languages qt)
|
||||
fi
|
||||
@ -559,8 +608,7 @@ if test "$found_py" = "1"; then
|
||||
if test "$found_py" = "1" -o "$found_py3" = "1"; then
|
||||
# Reset everything, so that we can look for another Python.
|
||||
m4_foreach([mym4pythonver],
|
||||
[[2.7],[3.4],[3.5],[3.6],[3.7],[3.8],[3.9],[3.10],
|
||||
[3.11],[3.12],[all]],
|
||||
[[2.7],[3.6],[3.8],[3.9],[3.10],[3.11],[3.12],[all]],
|
||||
[unset PYTHON
|
||||
unset PYTHON_VERSION
|
||||
unset PYTHON_CPPFLAGS
|
||||
@ -576,7 +624,7 @@ if test "$found_py" = "1"; then
|
||||
unset am_cv_python_pythondir
|
||||
unset am_cv_python_pyexecdir
|
||||
AM_PATH_PYTHON(mym4pythonver, [
|
||||
AX_PYTHON_DEVEL
|
||||
AX_PYTHON_DEVEL([], [true])
|
||||
if test "$PYTHON_VERSION"; then
|
||||
PYTHONS="$(echo $PYTHONS $PYTHON)"
|
||||
PYTHON_VERSIONS="$(echo $PYTHON_VERSIONS $PYTHON_VERSION)"
|
||||
@ -1115,7 +1163,9 @@ AC_CONFIG_FILES([lang/python/Makefile
|
||||
AC_CONFIG_FILES([lang/python/setup.py], [chmod a+x lang/python/setup.py])
|
||||
AC_OUTPUT
|
||||
|
||||
if test "$want_qt5" = "yes"; then
|
||||
if test "$want_qt5" = "yes" -a "$want_qt6" = "yes"; then
|
||||
enabled_languages_v=$(echo ${enabled_languages_v:-$enabled_languages} | sed "s/qt/qt (Qt 5, Qt 6)/")
|
||||
elif test "$want_qt5" = "yes"; then
|
||||
enabled_languages_v=$(echo ${enabled_languages_v:-$enabled_languages} | sed "s/qt/qt (Qt 5)/")
|
||||
elif test "$want_qt6" = "yes"; then
|
||||
enabled_languages_v=$(echo ${enabled_languages_v:-$enabled_languages} | sed "s/qt/qt (Qt 6)/")
|
||||
|
208
doc/gpgme.texi
208
doc/gpgme.texi
@ -551,7 +551,7 @@ convention for 32 bit Windows by using @code{long} there.
|
||||
and thus we are able to use @code{int64_t} instead of @code{off_t}
|
||||
there. For easier migration the typedef @code{gpgme_off_t} has been
|
||||
defined. The reason we cannot use @code{off_t} directly is that some
|
||||
toolchains (e.g. mingw64) introduce a POSIX compatible hack for
|
||||
toolchains (e.g., mingw64) introduce a POSIX compatible hack for
|
||||
@code{off_t}. Some widely used toolkits make use of this hack and in
|
||||
turn @acronym{GPGME} would need to use it also. However, this would
|
||||
introduce an ABI break and existing software making use of libgpgme
|
||||
@ -589,10 +589,16 @@ mode (@code{_LARGEFILE64_SOURCE}).
|
||||
@cindex automake
|
||||
@cindex autoconf
|
||||
|
||||
It is much easier if you use GNU Automake instead of writing your own
|
||||
Makefiles. If you do that you do not have to worry about finding and
|
||||
invoking the @command{pkg-config} script at all. @acronym{GPGME}
|
||||
provides an extension to Automake that does all the work for you.
|
||||
You can simply use @code{PKG_CHECK_MODULES} macro with @command{pkg-config}:
|
||||
@example
|
||||
PKG_CHECK_MODULES([GPGME], [gpgme >= 1.23.1])
|
||||
@end example
|
||||
|
||||
Alternatively, instead of using @command{pkg-config}, for building on
|
||||
an environment with no pkg-config, @acronym{GPGME} provides an
|
||||
extension to Automake that does all the work for you. Please note
|
||||
that it is required to have gpgrt-config from libgpg-error installed
|
||||
in this case.
|
||||
|
||||
@c A simple macro for optional variables.
|
||||
@macro ovar{varname}
|
||||
@ -1304,8 +1310,8 @@ returned.
|
||||
|
||||
The function @code{gpgme_pubkey_algo_string} is a convenience function
|
||||
to build and return an algorithm string in the same way GnuPG does
|
||||
(e.g. ``rsa2048'' or ``ed25519''). The caller must free the result
|
||||
using @code{gpgme_free}. On error (e.g. invalid argument or memory
|
||||
(e.g., ``rsa2048'' or ``ed25519''). The caller must free the result
|
||||
using @code{gpgme_free}. On error (e.g., invalid argument or memory
|
||||
exhausted), the function returns NULL and sets @code{ERRNO}.
|
||||
@end deftypefun
|
||||
|
||||
@ -1795,7 +1801,7 @@ is used.
|
||||
|
||||
On POSIX platforms the @code{gpgme_off_t} type is an alias for
|
||||
@code{off_t}; it may be used interchangeable. On Windows platforms
|
||||
@code{gpgme_off_t} is defined as a long (i.e. 32 bit) for 32 bit
|
||||
@code{gpgme_off_t} is defined as a long (i.e., 32 bit) for 32 bit
|
||||
Windows and as a 64 bit signed integer for 64 bit Windows.
|
||||
@end deftp
|
||||
|
||||
@ -2231,7 +2237,7 @@ for a new data object. The backend will try its best to detect the
|
||||
encoding automatically.
|
||||
|
||||
@item GPGME_DATA_ENCODING_BINARY
|
||||
This specifies that the data is encoding in binary form; i.e. there is
|
||||
This specifies that the data is encoding in binary form; i.e., there is
|
||||
no special encoding.
|
||||
|
||||
@item GPGME_DATA_ENCODING_BASE64
|
||||
@ -2271,7 +2277,7 @@ characters percent escaped. This mode is is not yet implemented.
|
||||
@deftypefun gpgme_data_encoding_t gpgme_data_get_encoding (@w{gpgme_data_t @var{dh}})
|
||||
The function @code{gpgme_data_get_encoding} returns the encoding of
|
||||
the data object with the handle @var{dh}. If @var{dh} is not a valid
|
||||
pointer (e.g. @code{NULL}) @code{GPGME_DATA_ENCODING_NONE} is
|
||||
pointer (e.g., @code{NULL}) @code{GPGME_DATA_ENCODING_NONE} is
|
||||
returned.
|
||||
@end deftypefun
|
||||
|
||||
@ -2601,7 +2607,7 @@ addresses is not supported.
|
||||
|
||||
The function @code{gpgme_set_sender} specifies the sender address for
|
||||
use in sign and verify operations. @var{address} is expected to be
|
||||
the ``addr-spec'' part of an address but my also be a complete mailbox
|
||||
the ``addr-spec'' part of an address but may also be a complete mailbox
|
||||
address, in which case this function extracts the ``addr-spec'' from
|
||||
it. Using @code{NULL} for @var{address} clears the sender address.
|
||||
|
||||
@ -2694,7 +2700,7 @@ for example completely disable the use of Dirmngr for any engine.
|
||||
|
||||
For the CMS protocol the offline mode specifies whether Dirmngr shall
|
||||
be used to do additional validation that might require connecting
|
||||
external services (e.g. CRL / OCSP checks). The offline mode is used
|
||||
external services (e.g., CRL / OCSP checks). The offline mode is used
|
||||
for all operations on this context. It has only an effect with
|
||||
GnuPG versions 2.1.6 or later.
|
||||
|
||||
@ -3273,6 +3279,12 @@ The string given in @var{value} is passed to the GnuPG engine to use as
|
||||
filter when importing keys. Valid values are documented in the GnuPG
|
||||
manual and the gpg man page under the option @option{--import-filter}.
|
||||
|
||||
@item "import-options"
|
||||
@since{1.24.0}
|
||||
The string given in @var{value} is passed to the GnuPG engine to use as
|
||||
options when importing keys. Valid values are documented in the GnuPG
|
||||
manual and the gpg man page under the option @option{--import-options}.
|
||||
|
||||
@item "no-auto-check-trustdb"
|
||||
@since{1.19.0}
|
||||
Setting the @var{value} to "1" forces the GPG backend to disable the
|
||||
@ -3461,22 +3473,47 @@ listings if the key could not be validated due to missing
|
||||
certificates or unmatched policies.
|
||||
|
||||
@item unsigned int can_encrypt : 1
|
||||
This is true if the key (ie one of its subkeys) can be used for
|
||||
encryption.
|
||||
This is true if the key or one of its subkeys can be used for
|
||||
encryption and the encryption will likely succeed.
|
||||
|
||||
@item unsigned int can_sign : 1
|
||||
This is true if the key (ie one of its subkeys) can be used to create
|
||||
data signatures.
|
||||
This is true if the key or one of its subkeys can be used to create
|
||||
data signatures and the signing will likely succeed.
|
||||
|
||||
@item unsigned int can_certify : 1
|
||||
This is true if the key (ie one of its subkeys) can be used to create
|
||||
This is true if the key or one of its subkeys can be used to create
|
||||
key certificates.
|
||||
|
||||
@item unsigned int can_authenticate : 1
|
||||
@since{0.4.5}
|
||||
|
||||
This is true if the key (ie one of its subkeys) can be used for
|
||||
authentication.
|
||||
authentication and the authentication will likely succeed.
|
||||
|
||||
@item unsigned int has_encrypt : 1
|
||||
@since{1.23.0}
|
||||
|
||||
This is true if the key or one of its subkeys is capable of encryption.
|
||||
Note that this flag is set even if the key is expired.
|
||||
|
||||
@item unsigned int has_sign : 1
|
||||
@since{1.23.0}
|
||||
|
||||
This is true if the key or one of its subkeys is capable of signing.
|
||||
Note that this flag is set even if the key is expired.
|
||||
|
||||
@item unsigned int has_certify : 1
|
||||
@since{1.23.0}
|
||||
|
||||
This is true if the key or one of its subkeys is capable of
|
||||
certification. Note that this flag is set even if the key is expired.
|
||||
|
||||
@item unsigned int has_authenticate : 1
|
||||
@since{1.23.0}
|
||||
|
||||
This is true if the key or one of its subkeys is capable of
|
||||
authentication. Note that this flag is set even if the key is
|
||||
expired.
|
||||
|
||||
@item unsigned int is_qualified : 1
|
||||
@since{1.1.0}
|
||||
@ -3535,6 +3572,10 @@ be missing but this field may be set nevertheless.
|
||||
|
||||
Reserved for the time of the last update of this key.
|
||||
|
||||
@item gpgme_revocation_key_t revkeys
|
||||
@since{1.24.0}
|
||||
This is a linked list with the revocation keys for the key.
|
||||
|
||||
@end table
|
||||
@end deftp
|
||||
|
||||
@ -3598,7 +3639,7 @@ Brainpool curve.
|
||||
|
||||
@item unsigned int secret : 1
|
||||
This is true if the subkey is a secret key. Note that it will be
|
||||
false if the key is actually a stub key; i.e. a secret key operation
|
||||
false if the key is actually a stub key; i.e., a secret key operation
|
||||
is currently not possible (offline-key). This is only set if a
|
||||
listing of secret keys has been requested or if
|
||||
@code{GPGME_KEYLIST_MODE_WITH_SECRET} is active.
|
||||
@ -3877,6 +3918,37 @@ This is a linked list with the notation data and policy URLs.
|
||||
@end deftp
|
||||
|
||||
|
||||
@deftp {Data type} gpgme_revocation_key_t
|
||||
@since{1.24.0}
|
||||
|
||||
The @code{gpgme_revocation_key_t} type is a pointer to a revocation key
|
||||
structure. Revocation key structures are one component of a
|
||||
@code{gpgme_key_t} object. They provide information about the designated
|
||||
revocation keys for a key.
|
||||
|
||||
The revocation key structure has the following members:
|
||||
|
||||
@table @code
|
||||
@item gpgme_revocation_key_t next
|
||||
This is a pointer to the next revocation key structure in the linked list,
|
||||
or @code{NULL} if this is the last element.
|
||||
|
||||
@item gpgme_pubkey_algo_t pubkey_algo
|
||||
This is the public key algorithm of the revocation key.
|
||||
|
||||
@item char *fpr
|
||||
This is the fingerprint of the revocation_key in hexadecimal digits.
|
||||
|
||||
@item unsigned int key_class
|
||||
This is the class of the revocation key signature subpacket.
|
||||
|
||||
@item unsigned int sensitive : 1
|
||||
This is true if the revocation key is marked as sensitive.
|
||||
|
||||
@end table
|
||||
@end deftp
|
||||
|
||||
|
||||
|
||||
@node Listing Keys
|
||||
@subsection Listing Keys
|
||||
@ -4241,7 +4313,7 @@ GnuPG.
|
||||
@var{userid} is commonly the mail address associated with the key.
|
||||
GPGME does not require a specific syntax but if more than a mail
|
||||
address is given, RFC-822 style format is suggested. The value is
|
||||
expected to be in UTF-8 encoding (i.e. no IDN encoding for mail
|
||||
expected to be in UTF-8 encoding (i.e., no IDN encoding for mail
|
||||
addresses). This is a required parameter.
|
||||
|
||||
@var{algo} specifies the algorithm for the new key (actually a keypair
|
||||
@ -4324,6 +4396,14 @@ override this check.
|
||||
|
||||
Request generation of keys that do not expire.
|
||||
|
||||
@item GPGME_CREATE_ADSK
|
||||
@since{1.24.0}
|
||||
|
||||
Add an ADSK to the key. With this flag @var{algo} is expected to be
|
||||
the hexified fingerprint of the ADSK to be added; this must be a
|
||||
subkey. If the string "default" is used for @var{algo} the engine
|
||||
will add all ADSK as it would do for new keys.
|
||||
|
||||
@end table
|
||||
|
||||
After the operation completed successfully, information about the
|
||||
@ -4399,6 +4479,10 @@ values for timestamps and thus can only encode dates up to the year
|
||||
@var{flags} takes the same values as described above for
|
||||
@code{gpgme_op_createkey}.
|
||||
|
||||
If the @code{GPGME_CREATE_ADSK} flag is set, the subkey fingerprint
|
||||
given in the @code{algo} parameter is added as an ADSK
|
||||
to the key.
|
||||
|
||||
After the operation completed successfully, information about the
|
||||
created key can be retrieved with @code{gpgme_op_genkey_result}.
|
||||
|
||||
@ -4450,7 +4534,7 @@ requires at least version 2.1.13 of GnuPG.
|
||||
the mail address to be associated with the key. GPGME does not
|
||||
require a specific syntax but if more than a mail address is given,
|
||||
RFC-822 style format is suggested. The value is expected to be in
|
||||
UTF-8 encoding (i.e. no IDN encoding for mail addresses). This is a
|
||||
UTF-8 encoding (i.e., no IDN encoding for mail addresses). This is a
|
||||
required parameter.
|
||||
|
||||
@var{flags} are currently not used and must be set to zero.
|
||||
@ -4659,7 +4743,7 @@ retrieved with @code{gpgme_op_genkey_result}.
|
||||
|
||||
The function returns the error code @code{GPG_ERR_NO_ERROR} if the
|
||||
operation could be started successfully, @code{GPG_ERR_INV_VALUE} if
|
||||
@var{parms} is not a well-formed string (e.g. does not have the
|
||||
@var{parms} is not a well-formed string (e.g., does not have the
|
||||
expected tag-like headers and footers), @code{GPG_ERR_NOT_SUPPORTED}
|
||||
if @var{public} or @var{secret} is not valid, and
|
||||
@code{GPG_ERR_GENERAL} if no key was created by the backend.
|
||||
@ -5122,7 +5206,7 @@ The function @code{gpgme_op_import_keys} adds the keys described by
|
||||
the @code{NULL} terminated array @var{keys} to the key ring of the
|
||||
crypto engine used by @var{ctx}. It is used to actually import and
|
||||
make keys permanent which have been retrieved from an external source
|
||||
(i.e. using @code{GPGME_KEYLIST_MODE_EXTERN}) earlier. The external
|
||||
(i.e., using @code{GPGME_KEYLIST_MODE_EXTERN}) earlier. The external
|
||||
keylisting must have been made with the same context configuration (in
|
||||
particular the same home directory). @footnote{Thus it is a
|
||||
replacement for the usual workaround of exporting and then importing a
|
||||
@ -5132,7 +5216,7 @@ require another access to the keyserver over the network.
|
||||
Only keys of the currently selected protocol of @var{ctx} are
|
||||
considered for import. Other keys specified by the @var{keys} are
|
||||
ignored. As of now all considered keys must have been retrieved using
|
||||
the same method, i.e. the used key listing mode must be identical.
|
||||
the same method, i.e., the used key listing mode must be identical.
|
||||
|
||||
After the operation completed successfully, the result can be
|
||||
retrieved with @code{gpgme_op_import_result}.
|
||||
@ -5204,7 +5288,7 @@ This is a pointer to the next status structure in the linked list, or
|
||||
|
||||
@item char *fpr
|
||||
This is the fingerprint of the key that was considered, or @code{NULL}
|
||||
if the fingerprint of the key is not known, e.g. because the key to
|
||||
if the fingerprint of the key is not known, e.g., because the key to
|
||||
import was encrypted and decryption failed.
|
||||
|
||||
@item gpgme_error_t result
|
||||
@ -5352,16 +5436,19 @@ operation was started successfully, and @code{GPG_ERR_INV_VALUE} if
|
||||
@var{ctx} or @var{key} is not a valid pointer.
|
||||
@end deftypefun
|
||||
|
||||
The following functions allow only to use one particular flag.
|
||||
The following functions allow only to use one particular flag. Their
|
||||
use is thus deprecated.
|
||||
|
||||
@deftypefun gpgme_error_t gpgme_op_delete (@w{gpgme_ctx_t @var{ctx}}, @w{const gpgme_key_t @var{key}}, @w{int @var{allow_secret}})
|
||||
Similar to @code{gpgme_op_delete_ext}, but only the flag
|
||||
@code{GPGME_DELETE_ALLOW_SECRET} can be provided.
|
||||
@code{GPGME_DELETE_ALLOW_SECRET} can be provided. Actually all true
|
||||
values are mapped to this flag.
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun gpgme_error_t gpgme_op_delete_start (@w{gpgme_ctx_t @var{ctx}}, @w{const gpgme_key_t @var{key}}, @w{int @var{allow_secret}})
|
||||
Similar to @code{gpgme_op_delete_ext_start}, but only the flag
|
||||
@code{GPGME_DELETE_ALLOW_SECRET} can be provided.
|
||||
@code{GPGME_DELETE_ALLOW_SECRET} can be provided. Actually all true
|
||||
values are mapped to this flag.
|
||||
@end deftypefun
|
||||
|
||||
|
||||
@ -5605,7 +5692,9 @@ An error code describing the reason why the key was found invalid.
|
||||
The function @code{gpgme_op_decrypt} decrypts the ciphertext in the
|
||||
data object @var{cipher} or, if a file name is set on the data object,
|
||||
the ciphertext stored in the corresponding file. The decrypted
|
||||
ciphertext is stored into the data object @var{plain}.
|
||||
ciphertext is stored into the data object @var{plain} or written to
|
||||
the file set with @code{gpgme_data_set_file_name} for the data object
|
||||
@var{plain}.
|
||||
|
||||
The function returns the error code @code{GPG_ERR_NO_ERROR} if the
|
||||
ciphertext could be decrypted successfully, @code{GPG_ERR_INV_VALUE}
|
||||
@ -5821,7 +5910,9 @@ writable data object that will contain the plaintext after successful
|
||||
verification. If a file name is set on the data object @var{sig} (or
|
||||
on the data object @var{signed_text}), then the data of the signature
|
||||
(resp. the data of the signed text) is not read from the data object
|
||||
but from the file with the given file name.
|
||||
but from the file with the given file name. If a file name is set on
|
||||
the data object @var{plain} then the plaintext is not stored in the
|
||||
data object but it is written to a file with the given file name.
|
||||
|
||||
The results of the individual signature verifications can be retrieved
|
||||
with @code{gpgme_op_verify_result}.
|
||||
@ -6000,7 +6091,7 @@ The defined bits are:
|
||||
|
||||
@item GPGME_SIGSUM_RED
|
||||
The signature is bad. It might be useful to check other bits and
|
||||
display more information, i.e. a revoked certificate might not render a
|
||||
display more information, i.e., a revoked certificate might not render a
|
||||
signature invalid when the message was received prior to the cause for
|
||||
the revocation.
|
||||
|
||||
@ -6246,7 +6337,7 @@ functions in GPGME and GnuPG:
|
||||
|
||||
Return the mail address (called ``addr-spec'' in RFC-5322) from the
|
||||
string @var{uid} which is assumed to be a user id (called ``address''
|
||||
in RFC-5322). All plain ASCII characters (i.e. those with bit 7
|
||||
in RFC-5322). All plain ASCII characters (i.e., those with bit 7
|
||||
cleared) in the result are converted to lowercase. Caller must free
|
||||
the result using @code{gpgme_free}. Returns @code{NULL} if no valid
|
||||
address was found (in which case @code{ERRNO} is set to @code{EINVAL})
|
||||
@ -6341,6 +6432,16 @@ A signed archive is created from the given files and directories. This
|
||||
feature is currently only supported for the OpenPGP crypto engine and requires
|
||||
GnuPG 2.4.1.
|
||||
|
||||
@item GPGME_SIG_MODE_FILE
|
||||
@since{1.24.0}
|
||||
|
||||
The filename set with @code{gpgme_data_set_file_name} for the data object
|
||||
@var{plain} is passed to gpg, so that gpg reads the plaintext directly from
|
||||
this file instead of from the data object @var{plain}. This flag can be
|
||||
combined with @code{GPGME_SIG_MODE_NORMAL}, @code{GPGME_SIG_MODE_DETACH},
|
||||
and @code{GPGME_SIG_MODE_CLEAR}, but not with @code{GPGME_SIG_MODE_ARCHIVE}.
|
||||
This feature is currently only supported for the OpenPGP crypto engine.
|
||||
|
||||
@end table
|
||||
@end deftp
|
||||
|
||||
@ -6354,12 +6455,17 @@ if that is not set, by the encoding specified for @var{sig}), the text
|
||||
mode attributes set for the context @var{ctx} and the requested signature
|
||||
mode @var{mode}.
|
||||
|
||||
If signature mode @code{GPGME_SIG_MODE_ARCHIVE} is requested, then a
|
||||
If the signature mode flag @code{GPGME_SIG_MODE_FILE} is set and a filename
|
||||
has been set with @code{gpgme_data_set_file_name} for the data object
|
||||
@var{plain}, then this filename is passed to gpg, so that gpg reads the
|
||||
plaintext directly from this file instead of from the data object @var{plain}.
|
||||
|
||||
If signature mode @code{GPGME_SIG_MODE_ARCHIVE} is requested then a
|
||||
signed archive is created from the files and directories given as
|
||||
NUL-separated list in the data object @var{plain} and returned in the
|
||||
data object @var{sig}. The paths of the files and directories have to
|
||||
be given as paths relative to the current working directory or relative
|
||||
to the base directory set with @code{gpgme_data_set_file_name}.
|
||||
NUL-separated list in the data object @var{plain}. The paths of the files
|
||||
and directories have to be given as paths relative to the current working
|
||||
directory or relative to the base directory set with
|
||||
@code{gpgme_data_set_file_name} for the data object @var{plain}.
|
||||
|
||||
After the operation completed successfully, the result can be
|
||||
retrieved with @code{gpgme_op_sign_result}.
|
||||
@ -6532,14 +6638,21 @@ file set with @code{gpgme_data_set_file_name} for the data object
|
||||
@var{cipher}. The type of the ciphertext created is determined by the
|
||||
@acronym{ASCII} armor (or, if that is not set, by the encoding specified
|
||||
for @var{cipher}) and the text mode attributes set for the context
|
||||
@var{ctx}.
|
||||
@var{ctx}. If a filename has been set with @code{gpgme_data_set_file_name}
|
||||
for the data object @var{plain} then this filename is stored in the
|
||||
ciphertext.
|
||||
|
||||
If the flag @code{GPGME_ENCRYPT_FILE} is set and a filename has been set
|
||||
with @code{gpgme_data_set_file_name} for the data object @var{plain},
|
||||
then this filename is passed to gpg, so that gpg reads the plaintext
|
||||
directly from this file instead of from the data object @var{plain}.
|
||||
|
||||
If the flag @code{GPGME_ENCRYPT_ARCHIVE} is set, then an encrypted
|
||||
archive is created from the files and directories given as NUL-separated
|
||||
list in the data object @var{plain} and returned in the data object
|
||||
@var{cipher}. The paths of the files and directories have to
|
||||
be given as paths relative to the current working directory or relative
|
||||
to the base directory set with @code{gpgme_data_set_file_name}.
|
||||
list in the data object @var{plain}. The paths of the files and
|
||||
directories have to be given as paths relative to the current working
|
||||
directory or relative to the base directory set with
|
||||
@code{gpgme_data_set_file_name} for the data object @var{plain}.
|
||||
|
||||
@var{recp} must be a @code{NULL}-terminated array of keys. The user
|
||||
must keep references for all keys during the whole duration of the
|
||||
@ -6579,7 +6692,7 @@ may reveal information about the plaintext.
|
||||
@item GPGME_ENCRYPT_PREPARE
|
||||
@itemx GPGME_ENCRYPT_EXPECT_SIGN
|
||||
The @code{GPGME_ENCRYPT_PREPARE} symbol is used with the UI Server
|
||||
protocol to prepare an encryption (i.e. sending the
|
||||
protocol to prepare an encryption (i.e., sending the
|
||||
@code{PREP_ENCRYPT} command). With the
|
||||
@code{GPGME_ENCRYPT_EXPECT_SIGN} symbol the UI Server is advised to
|
||||
also expect a sign command.
|
||||
@ -6628,6 +6741,15 @@ NUL-separated list of file paths and directory paths that shall be
|
||||
encrypted into an archive. This feature is currently only supported
|
||||
for the OpenPGP crypto engine and requires GnuPG 2.4.1.
|
||||
|
||||
@item GPGME_ENCRYPT_FILE
|
||||
@since{1.24.0}
|
||||
|
||||
The @code{GPGME_ENCRYPT_FILE} symbol specifies that the filename set
|
||||
with @code{gpgme_data_set_file_name} for the data object @var{plain}
|
||||
is passed to gpg, so that gpg reads the plaintext directly from this
|
||||
file instead of from the data object @var{plain}. This feature is
|
||||
currently only supported for the OpenPGP crypto engine.
|
||||
|
||||
@end table
|
||||
|
||||
If @code{GPG_ERR_UNUSABLE_PUBKEY} is returned, some recipients in
|
||||
|
@ -498,7 +498,7 @@
|
||||
% \def\foo{\parsearg\Xfoo}
|
||||
% \def\Xfoo#1{...}
|
||||
%
|
||||
% Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my
|
||||
% Actually, I use \csname\string\foo\endcsname, i.e. \\foo, as it is my
|
||||
% favourite TeX trick. --kasal, 16nov03
|
||||
|
||||
\def\parseargdef#1{%
|
||||
|
@ -88,6 +88,14 @@ else
|
||||
libsuffix=.so
|
||||
endif
|
||||
|
||||
copied_headers = $(gpgmepp_headers:%=gpgme++/%) $(interface_headers:%=gpgme++/%)
|
||||
|
||||
$(copied_headers): Makefile.am
|
||||
mkdir -p $(builddir)/gpgme++/interfaces
|
||||
echo -n "#include \"$(abs_srcdir)" > "$@"
|
||||
echo -n "$@" | sed "s/gpgme++//" >> "$@"
|
||||
echo "\"" >> "$@"
|
||||
|
||||
if HAVE_W32_SYSTEM
|
||||
GpgmeppConfig.cmake: GpgmeppConfig-w32.cmake.in
|
||||
sed -e 's|[@]resolved_bindir@|$(bindir)|g' < "$<" | \
|
||||
@ -115,5 +123,8 @@ install-data-local: install-cmake-files
|
||||
|
||||
uninstall-local: uninstall-cmake-files
|
||||
|
||||
BUILT_SOURCES = $(copied_headers)
|
||||
|
||||
CLEANFILES = GpgmeppConfig.cmake GpgmeppConfigVersion.cmake \
|
||||
gpgmepp_version.h GpgmeppConfig.cmake.in
|
||||
gpgmepp_version.h GpgmeppConfig.cmake.in \
|
||||
$(copied_headers)
|
||||
|
@ -257,158 +257,6 @@ Type Option::alternateType() const
|
||||
return isNull() ? NoType : static_cast<Type>(opt->alt_type) ;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static Option::Variant argument_to_variant(gpgme_conf_type_t type, bool list, gpgme_conf_arg_t arg)
|
||||
{
|
||||
assert(arg);
|
||||
switch (type) {
|
||||
case GPGME_CONF_NONE:
|
||||
if (list) {
|
||||
// return the count (number of times set):
|
||||
return arg->value.count;
|
||||
} else {
|
||||
return none;
|
||||
}
|
||||
case GPGME_CONF_INT32:
|
||||
if (list) {
|
||||
std::vector<int> result;
|
||||
for (gpgme_conf_arg_t a = arg ; a ; a = a->next) {
|
||||
result.push_back(a->value.int32);
|
||||
}
|
||||
return result;
|
||||
} else {
|
||||
return arg->value.int32;
|
||||
}
|
||||
case GPGME_CONF_UINT32:
|
||||
if (list) {
|
||||
std::vector<unsigned int> result;
|
||||
for (gpgme_conf_arg_t a = arg ; a ; a = a->next) {
|
||||
result.push_back(a->value.uint32);
|
||||
}
|
||||
return result;
|
||||
} else {
|
||||
return arg->value.uint32;
|
||||
}
|
||||
case GPGME_CONF_FILENAME:
|
||||
case GPGME_CONF_LDAP_SERVER:
|
||||
case GPGME_CONF_KEY_FPR:
|
||||
case GPGME_CONF_PUB_KEY:
|
||||
case GPGME_CONF_SEC_KEY:
|
||||
case GPGME_CONF_ALIAS_LIST:
|
||||
// these should not happen in alt_type, but fall through
|
||||
case GPGME_CONF_STRING:
|
||||
if (list) {
|
||||
std::vector<const char *> result;
|
||||
for (gpgme_conf_arg_t a = arg ; a ; a = a->next) {
|
||||
result.push_back(a->value.string);
|
||||
}
|
||||
return result;
|
||||
} else {
|
||||
return arg->value.string;
|
||||
}
|
||||
}
|
||||
assert(!"Option: unknown alt_type!");
|
||||
return Option::Variant();
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
inline const void *to_void_star(const char *s)
|
||||
{
|
||||
return s;
|
||||
}
|
||||
inline const void *to_void_star(const std::string &s)
|
||||
{
|
||||
return s.c_str();
|
||||
}
|
||||
inline const void *to_void_star(const int &i)
|
||||
{
|
||||
return &i; // const-&: sic!
|
||||
}
|
||||
inline const void *to_void_star(const unsigned int &i)
|
||||
{
|
||||
return &i; // const-&: sic!
|
||||
}
|
||||
|
||||
struct VariantToArgumentVisitor : boost::static_visitor<gpgme_conf_arg_t> {
|
||||
static gpgme_conf_arg_t make_argument(gpgme_conf_type_t type, const void *value)
|
||||
{
|
||||
gpgme_conf_arg_t arg = 0;
|
||||
#ifdef HAVE_GPGME_CONF_ARG_NEW_WITH_CONST_VALUE
|
||||
if (const gpgme_error_t err = gpgme_conf_arg_new(&arg, type, value)) {
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
if (const gpgme_error_t err = gpgme_conf_arg_new(&arg, type, const_cast<void *>(value))) {
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
else {
|
||||
return arg;
|
||||
}
|
||||
}
|
||||
|
||||
gpgme_conf_arg_t operator()(bool v) const
|
||||
{
|
||||
return v ? make_argument(0) : 0 ;
|
||||
}
|
||||
|
||||
gpgme_conf_arg_t operator()(const char *s) const
|
||||
{
|
||||
return make_argument(s ? s : "");
|
||||
}
|
||||
|
||||
gpgme_conf_arg_t operator()(const std::string &s) const
|
||||
{
|
||||
return operator()(s.c_str());
|
||||
}
|
||||
|
||||
gpgme_conf_arg_t operator()(int i) const
|
||||
{
|
||||
return make_argument(&i);
|
||||
}
|
||||
|
||||
gpgme_conf_arg_t operator()(unsigned int i) const
|
||||
{
|
||||
return make_argument(&i);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
gpgme_conf_arg_t operator()(const std::vector<T> &value) const
|
||||
{
|
||||
gpgme_conf_arg_t result = 0;
|
||||
gpgme_conf_arg_t last = 0;
|
||||
for (typename std::vector<T>::const_iterator it = value.begin(), end = value.end() ; it != end ; ++it) {
|
||||
if (gpgme_conf_arg_t arg = make_argument(to_void_star(*it))) {
|
||||
if (last) {
|
||||
last = last->next = arg;
|
||||
} else {
|
||||
result = last = arg;
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
static gpgme_conf_arg_t variant_to_argument(const Option::Variant &value)
|
||||
{
|
||||
VariantToArgumentVisitor v;
|
||||
return apply_visitor(v, value);
|
||||
}
|
||||
|
||||
optional<Option::Variant> Option::defaultValue() const
|
||||
{
|
||||
if (isNull()) {
|
||||
return optional<Variant>();
|
||||
} else {
|
||||
return argument_to_variant(opt->alt_type, opt->flags & GPGME_CONF_LIST, opt->default_value);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Argument Option::defaultValue() const
|
||||
{
|
||||
if (isNull()) {
|
||||
|
@ -190,7 +190,7 @@ public:
|
||||
|
||||
/*! The value that is in the config file (or null, if it's not set). */
|
||||
Argument activeValue() const;
|
||||
/*! The value that is in this object, ie. either activeValue(), newValue(), or defaultValue() */
|
||||
/*! The value that is in this object, i.e. either activeValue(), newValue(), or defaultValue() */
|
||||
Argument currentValue() const;
|
||||
|
||||
Argument newValue() const;
|
||||
|
@ -130,6 +130,13 @@ const char *Error::asString() const
|
||||
return mMessage.c_str();
|
||||
}
|
||||
|
||||
std::string Error::asStdString() const
|
||||
{
|
||||
std::string message;
|
||||
format_error(static_cast<gpgme_error_t>(mErr), message);
|
||||
return message;
|
||||
}
|
||||
|
||||
int Error::code() const
|
||||
{
|
||||
return gpgme_err_code(mErr);
|
||||
@ -147,11 +154,7 @@ bool Error::isCanceled() const
|
||||
|
||||
int Error::toErrno() const
|
||||
{
|
||||
//#ifdef HAVE_GPGME_GPG_ERROR_WRAPPERS
|
||||
return gpgme_err_code_to_errno(static_cast<gpgme_err_code_t>(code()));
|
||||
//#else
|
||||
// return gpg_err_code_to_errno( static_cast<gpg_err_code_t>( code() ) );
|
||||
//#endif
|
||||
}
|
||||
|
||||
// static
|
||||
@ -192,7 +195,7 @@ Error Error::fromCode(unsigned int err, unsigned int src)
|
||||
|
||||
std::ostream &operator<<(std::ostream &os, const Error &err)
|
||||
{
|
||||
return os << "GpgME::Error(" << err.encodedError() << " (" << err.asString() << "))";
|
||||
return os << "GpgME::Error(" << err.encodedError() << " (" << err.asStdString() << "))";
|
||||
}
|
||||
|
||||
Context::KeyListModeSaver::KeyListModeSaver(Context *ctx)
|
||||
@ -1301,6 +1304,9 @@ static gpgme_sig_mode_t sigflags2sigflags(SignatureMode flags)
|
||||
if (flags & SignatureMode::SignArchive) {
|
||||
result |= GPGME_SIG_MODE_ARCHIVE;
|
||||
}
|
||||
if (flags & SignatureMode::SignFile) {
|
||||
result |= GPGME_SIG_MODE_FILE;
|
||||
}
|
||||
return static_cast<gpgme_sig_mode_t>(result);
|
||||
}
|
||||
|
||||
@ -1363,6 +1369,9 @@ static gpgme_encrypt_flags_t encryptflags2encryptflags(Context::EncryptionFlags
|
||||
if (flags & Context::EncryptArchive) {
|
||||
result |= GPGME_ENCRYPT_ARCHIVE;
|
||||
}
|
||||
if (flags & Context::EncryptFile) {
|
||||
result |= GPGME_ENCRYPT_FILE;
|
||||
}
|
||||
return static_cast<gpgme_encrypt_flags_t>(result);
|
||||
}
|
||||
|
||||
@ -1793,6 +1802,16 @@ Error Context::startRevokeSignature(const Key &key, const Key &signingKey,
|
||||
key.impl(), signingKey.impl(), uids.c_str(), flags));
|
||||
}
|
||||
|
||||
Error Context::addAdsk(const Key &k, const char *adsk)
|
||||
{
|
||||
return Error(d->lasterr = gpgme_op_createsubkey(d->ctx, k.impl(), adsk, 0, 0, GPGME_CREATE_ADSK));
|
||||
}
|
||||
|
||||
Error Context::startAddAdsk(const Key &k, const char *adsk)
|
||||
{
|
||||
return Error(d->lasterr = gpgme_op_createsubkey_start(d->ctx, k.impl(), adsk, 0, 0, GPGME_CREATE_ADSK));
|
||||
}
|
||||
|
||||
Error Context::setFlag(const char *name, const char *value)
|
||||
{
|
||||
return Error(d->lasterr = gpgme_set_ctx_flag(d->ctx, name, value));
|
||||
@ -1927,6 +1946,7 @@ std::ostream &operator<<(std::ostream &os, SignatureMode mode)
|
||||
}
|
||||
#define CHECK( x ) if ( !(mode & (x)) ) {} else do { os << #x " "; } while (0)
|
||||
CHECK(SignArchive);
|
||||
CHECK(SignFile);
|
||||
#undef CHECK
|
||||
return os << ')';
|
||||
}
|
||||
@ -1945,6 +1965,7 @@ std::ostream &operator<<(std::ostream &os, Context::EncryptionFlags flags)
|
||||
CHECK(EncryptWrap);
|
||||
CHECK(WantAddress);
|
||||
CHECK(EncryptArchive);
|
||||
CHECK(EncryptFile);
|
||||
#undef CHECK
|
||||
return os << ')';
|
||||
}
|
||||
|
@ -324,6 +324,9 @@ public:
|
||||
Error startRevokeSignature(const Key &key, const Key &signingKey,
|
||||
const std::vector<UserID> &userIds = std::vector<UserID>());
|
||||
|
||||
Error addAdsk(const Key &k, const char *adsk);
|
||||
Error startAddAdsk(const Key &k, const char *adsk);
|
||||
|
||||
// using TofuInfo::Policy
|
||||
Error setTofuPolicy(const Key &k, unsigned int policy);
|
||||
Error setTofuPolicyStart(const Key &k, unsigned int policy);
|
||||
@ -450,7 +453,8 @@ public:
|
||||
ThrowKeyIds = 64,
|
||||
EncryptWrap = 128,
|
||||
WantAddress = 256,
|
||||
EncryptArchive = 512
|
||||
EncryptArchive = 512,
|
||||
EncryptFile = 1024
|
||||
};
|
||||
EncryptionResult encrypt(const std::vector<Key> &recipients, const Data &plainText, Data &cipherText, EncryptionFlags flags);
|
||||
GpgME::Error encryptSymmetrically(const Data &plainText, Data &cipherText);
|
||||
|
@ -1,41 +0,0 @@
|
||||
/*
|
||||
context_glib.cpp - wraps a gpgme key context, gpgme-glib-specific functions
|
||||
Copyright (C) 2007 Klarälvdalens Datakonsult AB
|
||||
2016 Bundesamt für Sicherheit in der Informationstechnik
|
||||
Software engineering by Intevation GmbH
|
||||
|
||||
This file is part of GPGME++.
|
||||
|
||||
GPGME++ is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
GPGME++ is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with GPGME++; see the file COPYING.LIB. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <global.h>
|
||||
|
||||
extern "C" GIOChannel *gpgme_get_fdptr(int);
|
||||
|
||||
GIOChannel *GpgME::getGIOChannel(int fd)
|
||||
{
|
||||
return gpgme_get_fdptr(fd);
|
||||
}
|
||||
|
||||
QIODevice *GpgME::getQIODevice(int fd)
|
||||
{
|
||||
return 0;
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
/*
|
||||
context_qt.cpp - wraps a gpgme key context, gpgme-qt-specific functions
|
||||
Copyright (C) 2007 Klarälvdalens Datakonsult AB
|
||||
2016 Bundesamt für Sicherheit in der Informationstechnik
|
||||
Software engineering by Intevation GmbH
|
||||
|
||||
This file is part of GPGME++.
|
||||
|
||||
GPGME++ is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
GPGME++ is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with GPGME++; see the file COPYING.LIB. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <global.h>
|
||||
|
||||
extern "C" QIODevice *gpgme_get_fdptr(int);
|
||||
|
||||
GIOChannel *GpgME::getGIOChannel(int)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
QIODevice *GpgME::getQIODevice(int fd)
|
||||
{
|
||||
return gpgme_get_fdptr(fd);
|
||||
}
|
@ -25,7 +25,7 @@
|
||||
#ifndef __GPGMEPP_DEFAULTASSUANTRANSACTION_H__
|
||||
#define __GPGMEPP_DEFAULTASSUANTRANSACTION_H__
|
||||
|
||||
#include <interfaces/assuantransaction.h>
|
||||
#include "interfaces/assuantransaction.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
@ -52,6 +52,7 @@ using namespace GpgME;
|
||||
|
||||
static const char *status_to_string(unsigned int status);
|
||||
static Error status_to_error(unsigned int status);
|
||||
static Error parse_sc_op_failure(const char *args);
|
||||
|
||||
class EditInteractor::Private
|
||||
{
|
||||
@ -102,6 +103,9 @@ public:
|
||||
} else if (status == GPGME_STATUS_ERROR) {
|
||||
err = ei->q->parseStatusError(args);
|
||||
ei->state = EditInteractor::ErrorState;
|
||||
} else if (status == GPGME_STATUS_SC_OP_FAILURE) {
|
||||
err = parse_sc_op_failure(args);
|
||||
ei->state = EditInteractor::ErrorState;
|
||||
} else {
|
||||
ei->state = ei->q->nextState(status, args, err);
|
||||
}
|
||||
@ -134,7 +138,7 @@ public:
|
||||
if (writeAll(fd, result, len) != len) {
|
||||
err = Error::fromSystemError();
|
||||
if (ei->debug) {
|
||||
std::fprintf(ei->debug, "EditInteractor: Could not write to fd %d (%s)\n", fd, err.asString());
|
||||
std::fprintf(ei->debug, "EditInteractor: Could not write to fd %d (%s)\n", fd, err.asStdString().c_str());
|
||||
}
|
||||
goto error;
|
||||
}
|
||||
@ -143,7 +147,7 @@ public:
|
||||
if (writeAll(fd, "\n", 1) != 1) {
|
||||
err = Error::fromSystemError();
|
||||
if (ei->debug) {
|
||||
std::fprintf(ei->debug, "EditInteractor: Could not write to fd %d (%s)\n", fd, err.asString());
|
||||
std::fprintf(ei->debug, "EditInteractor: Could not write to fd %d (%s)\n", fd, err.asStdString().c_str());
|
||||
}
|
||||
goto error;
|
||||
}
|
||||
@ -280,6 +284,38 @@ GpgME::Error EditInteractor::parseStatusError(const char *args)
|
||||
return err;
|
||||
}
|
||||
|
||||
static Error sc_op_failure_to_error(unsigned int status)
|
||||
{
|
||||
switch (status) {
|
||||
case 1:
|
||||
// GPG_ERR_CANCELED or GPG_ERR_FULLY_CANCELED
|
||||
return Error::fromCode(GPG_ERR_CANCELED);
|
||||
case 2:
|
||||
// GPG_ERR_BAD_PIN or GPG_ERR_BAD_RESET_CODE [sic]
|
||||
return Error::fromCode(GPG_ERR_BAD_PIN);
|
||||
case 3:
|
||||
return Error::fromCode(GPG_ERR_PIN_BLOCKED);
|
||||
case 4:
|
||||
return Error::fromCode(GPG_ERR_NO_RESET_CODE);
|
||||
}
|
||||
return Error::fromCode(GPG_ERR_CARD);
|
||||
}
|
||||
|
||||
// static
|
||||
Error parse_sc_op_failure(const char *args)
|
||||
{
|
||||
Error err;
|
||||
|
||||
const auto fields = split(args, ' ');
|
||||
if (fields.size() >= 1) {
|
||||
err = sc_op_failure_to_error(static_cast<unsigned int>(std::stoul(fields[0])));
|
||||
} else {
|
||||
err = Error::fromCode(GPG_ERR_CARD);
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
static const char *const status_strings[] = {
|
||||
"EOF",
|
||||
/* mkstatus processing starts here */
|
||||
|
@ -47,7 +47,11 @@ public:
|
||||
explicit Error(unsigned int e) : mErr(e), mMessage() {}
|
||||
|
||||
const char *source() const;
|
||||
const char *asString() const;
|
||||
/* This function is deprecated. Use asStdString() instead. asString() may
|
||||
* return wrongly encoded (i.e. not UTF-8) results on Windows for the main
|
||||
* thread if the function was first called from a secondary thread. */
|
||||
GPGMEPP_DEPRECATED const char *asString() const;
|
||||
std::string asStdString() const;
|
||||
|
||||
int code() const;
|
||||
int sourceID() const;
|
||||
|
@ -79,6 +79,7 @@ enum SignatureMode {
|
||||
Detached = 1,
|
||||
Clearsigned = 2,
|
||||
SignArchive = 4,
|
||||
SignFile = 8,
|
||||
};
|
||||
|
||||
enum class RevocationReason {
|
||||
|
@ -25,7 +25,7 @@
|
||||
#ifndef __GPGMEPP_GPGADDUSERIDEDITINTERACTOR_H__
|
||||
#define __GPGMEPP_GPGADDUSERIDEDITINTERACTOR_H__
|
||||
|
||||
#include <editinteractor.h>
|
||||
#include "editinteractor.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
#ifndef __GPGMEPP_GPGAGENTGETINFOASSUANTRANSACTION_H__
|
||||
#define __GPGMEPP_GPGAGENTGETINFOASSUANTRANSACTION_H__
|
||||
|
||||
#include <interfaces/assuantransaction.h>
|
||||
#include "interfaces/assuantransaction.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
@ -24,7 +24,7 @@
|
||||
#ifndef __GPGMEPP_GPGGENCARDKEYEDITINTERACTOR_H__
|
||||
#define __GPGMEPP_GPGGENCARDKEYEDITINTERACTOR_H__
|
||||
|
||||
#include <editinteractor.h>
|
||||
#include "editinteractor.h"
|
||||
|
||||
#include <string>
|
||||
#include <memory>
|
||||
|
@ -75,4 +75,7 @@ typedef struct _gpgme_tofu_info *gpgme_tofu_info_t;
|
||||
struct _gpgme_op_query_swdb_result;
|
||||
typedef struct _gpgme_op_query_swdb_result *gpgme_query_swdb_result_t;
|
||||
|
||||
struct _gpgme_revocation_key;
|
||||
typedef struct _gpgme_revocation_key *gpgme_revocation_key_t;
|
||||
|
||||
#endif // __GPGMEPP_GPGMEFW_H__
|
||||
|
@ -25,7 +25,7 @@
|
||||
#ifndef __GPGMEPP_GPGSETEXPIRYTIMEEDITINTERACTOR_H__
|
||||
#define __GPGMEPP_GPGSETEXPIRYTIMEEDITINTERACTOR_H__
|
||||
|
||||
#include <editinteractor.h>
|
||||
#include "editinteractor.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
|
@ -25,8 +25,8 @@
|
||||
#ifndef __GPGMEPP_GPGSETOWNERTRUSTEDITINTERACTOR_H__
|
||||
#define __GPGMEPP_GPGSETOWNERTRUSTEDITINTERACTOR_H__
|
||||
|
||||
#include <editinteractor.h>
|
||||
#include <key.h>
|
||||
#include "editinteractor.h"
|
||||
#include "key.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
#ifndef __GPGMEPP_GPGSIGNKEYEDITINTERACTOR_H__
|
||||
#define __GPGMEPP_GPGSIGNKEYEDITINTERACTOR_H__
|
||||
|
||||
#include <editinteractor.h>
|
||||
#include "editinteractor.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
@ -26,7 +26,7 @@
|
||||
#ifndef __GPGMEPP_INTERFACES_ASSUANTRANSACTION_H__
|
||||
#define __GPGMEPP_INTERFACES_ASSUANTRANSACTION_H__
|
||||
|
||||
#include "gpgmepp_export.h"
|
||||
#include "../gpgmepp_export.h"
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
|
@ -27,7 +27,7 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "gpgmepp_export.h"
|
||||
#include "../gpgmepp_export.h"
|
||||
|
||||
#include <gpg-error.h>
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
#ifndef __GPGMEPP_INTERFACES_STATUSCONSUMER_H__
|
||||
#define __GPGMEPP_INTERFACES_STATUSCONSUMER_H__
|
||||
|
||||
#include "gpgmepp_export.h"
|
||||
#include "../gpgmepp_export.h"
|
||||
|
||||
namespace GpgME
|
||||
{
|
||||
|
@ -122,6 +122,37 @@ std::vector<Subkey> Key::subkeys() const
|
||||
return v;
|
||||
}
|
||||
|
||||
RevocationKey Key::revocationKey(unsigned int index) const
|
||||
{
|
||||
return RevocationKey(key, index);
|
||||
}
|
||||
|
||||
unsigned int Key::numRevocationKeys() const
|
||||
{
|
||||
if (!key) {
|
||||
return 0;
|
||||
}
|
||||
unsigned int count = 0;
|
||||
for (auto revkey = key->revocation_keys; revkey; revkey = revkey->next) {
|
||||
++count;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
std::vector<RevocationKey> Key::revocationKeys() const
|
||||
{
|
||||
if (!key) {
|
||||
return std::vector<RevocationKey>();
|
||||
}
|
||||
|
||||
std::vector<RevocationKey> v;
|
||||
v.reserve(numRevocationKeys());
|
||||
for (auto revkey = key->revocation_keys; revkey; revkey = revkey->next) {
|
||||
v.push_back(RevocationKey(key, revkey));
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
Key::OwnerTrust Key::ownerTrust() const
|
||||
{
|
||||
if (!key) {
|
||||
@ -247,6 +278,26 @@ bool Key::isDeVs() const
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Key::hasCertify() const
|
||||
{
|
||||
return key && key->has_certify;
|
||||
}
|
||||
|
||||
bool Key::hasSign() const
|
||||
{
|
||||
return key && key->has_sign;
|
||||
}
|
||||
|
||||
bool Key::hasEncrypt() const
|
||||
{
|
||||
return key && key->has_encrypt;
|
||||
}
|
||||
|
||||
bool Key::hasAuthenticate() const
|
||||
{
|
||||
return key && key->has_authenticate;
|
||||
}
|
||||
|
||||
const char *Key::issuerSerial() const
|
||||
{
|
||||
return key ? key->issuer_serial : nullptr ;
|
||||
@ -1236,6 +1287,68 @@ bool UserID::Signature::isBad() const
|
||||
return isNull() || isExpired() || isInvalid();
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
// class RevocationKey
|
||||
//
|
||||
//
|
||||
|
||||
static gpgme_revocation_key_t find_revkey(const shared_gpgme_key_t &key, unsigned int idx)
|
||||
{
|
||||
if (key) {
|
||||
for (gpgme_revocation_key_t s = key->revocation_keys; s; s = s->next, --idx) {
|
||||
if (idx == 0) {
|
||||
return s;
|
||||
}
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static gpgme_revocation_key_t verify_revkey(const shared_gpgme_key_t &key, gpgme_revocation_key_t revkey)
|
||||
{
|
||||
if (key) {
|
||||
for (gpgme_revocation_key_t s = key->revocation_keys; s; s = s->next) {
|
||||
if (s == revkey) {
|
||||
return revkey;
|
||||
}
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
RevocationKey::RevocationKey() : key(), revkey(nullptr) {}
|
||||
|
||||
RevocationKey::RevocationKey(const shared_gpgme_key_t &k, unsigned int idx)
|
||||
: key(k), revkey(find_revkey(k, idx))
|
||||
{
|
||||
}
|
||||
|
||||
RevocationKey::RevocationKey(const shared_gpgme_key_t &k, gpgme_revocation_key_t sk)
|
||||
: key(k), revkey(verify_revkey(k, sk))
|
||||
{
|
||||
}
|
||||
|
||||
Key RevocationKey::parent() const
|
||||
{
|
||||
return Key(key);
|
||||
}
|
||||
|
||||
const char *RevocationKey::fingerprint() const
|
||||
{
|
||||
return revkey ? revkey->fpr : nullptr;
|
||||
}
|
||||
|
||||
bool RevocationKey::isSensitive() const
|
||||
{
|
||||
return revkey ? revkey->sensitive : false;
|
||||
}
|
||||
|
||||
int RevocationKey::algorithm() const
|
||||
{
|
||||
return revkey ? revkey->pubkey_algo : 0;
|
||||
}
|
||||
|
||||
std::ostream &operator<<(std::ostream &os, const UserID &uid)
|
||||
{
|
||||
os << "GpgME::UserID(";
|
||||
@ -1305,6 +1418,20 @@ std::ostream &operator<<(std::ostream &os, const Key &key)
|
||||
const std::vector<Subkey> subkeys = key.subkeys();
|
||||
std::copy(subkeys.begin(), subkeys.end(),
|
||||
std::ostream_iterator<Subkey>(os, "\n"));
|
||||
os << " revocationKeys:\n";
|
||||
const std::vector<RevocationKey> revkeys = key.revocationKeys();
|
||||
std::copy(revkeys.begin(), revkeys.end(),
|
||||
std::ostream_iterator<RevocationKey>(os, "\n"));
|
||||
}
|
||||
return os << ')';
|
||||
}
|
||||
|
||||
std::ostream &operator<<(std::ostream &os, const RevocationKey &revkey)
|
||||
{
|
||||
os << "GpgME::RevocationKey(";
|
||||
if (!revkey.isNull()) {
|
||||
os << "\n fingerprint: " << protect(revkey.fingerprint())
|
||||
<< "\n isSensitive: " << revkey.isSensitive();
|
||||
}
|
||||
return os << ')';
|
||||
}
|
||||
|
@ -44,6 +44,7 @@ class Context;
|
||||
class Subkey;
|
||||
class UserID;
|
||||
class TofuInfo;
|
||||
class RevocationKey;
|
||||
|
||||
typedef std::shared_ptr< std::remove_pointer<gpgme_key_t>::type > shared_gpgme_key_t;
|
||||
|
||||
@ -100,6 +101,10 @@ public:
|
||||
std::vector<UserID> userIDs() const;
|
||||
std::vector<Subkey> subkeys() const;
|
||||
|
||||
RevocationKey revocationKey(unsigned int index) const;
|
||||
unsigned int numRevocationKeys() const;
|
||||
std::vector<RevocationKey> revocationKeys() const;
|
||||
|
||||
bool isRevoked() const;
|
||||
bool isExpired() const;
|
||||
bool isDisabled() const;
|
||||
@ -109,14 +114,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
|
||||
{
|
||||
@ -530,9 +552,53 @@ private:
|
||||
gpgme_key_sig_t sig;
|
||||
};
|
||||
|
||||
//
|
||||
// class RevocationKey
|
||||
//
|
||||
|
||||
class GPGMEPP_EXPORT RevocationKey
|
||||
{
|
||||
public:
|
||||
RevocationKey();
|
||||
RevocationKey(const shared_gpgme_key_t &key, gpgme_revocation_key_t revkey);
|
||||
RevocationKey(const shared_gpgme_key_t &key, unsigned int idx);
|
||||
|
||||
// Rule of Zero
|
||||
|
||||
void swap(RevocationKey &other)
|
||||
{
|
||||
using std::swap;
|
||||
swap(this->key, other.key);
|
||||
swap(this->revkey, other.revkey);
|
||||
}
|
||||
|
||||
bool isNull() const
|
||||
{
|
||||
return !key || !revkey;
|
||||
}
|
||||
|
||||
Key parent() const;
|
||||
|
||||
const char *fingerprint() const;
|
||||
|
||||
bool isSensitive() const;
|
||||
|
||||
int algorithm() const;
|
||||
|
||||
private:
|
||||
shared_gpgme_key_t key;
|
||||
gpgme_revocation_key_t revkey;
|
||||
};
|
||||
|
||||
inline void swap(RevocationKey& v1, RevocationKey& v2)
|
||||
{
|
||||
v1.swap(v2);
|
||||
}
|
||||
|
||||
GPGMEPP_EXPORT std::ostream &operator<<(std::ostream &os, const UserID &uid);
|
||||
GPGMEPP_EXPORT std::ostream &operator<<(std::ostream &os, const Subkey &subkey);
|
||||
GPGMEPP_EXPORT std::ostream &operator<<(std::ostream &os, const Key &key);
|
||||
GPGMEPP_EXPORT std::ostream &operator<<(std::ostream &os, const RevocationKey &revkey);
|
||||
|
||||
} // namespace GpgME
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
#ifndef __GPGMEPP_SCDGETINFOASSUANTRANSACTION_H__
|
||||
#define __GPGMEPP_SCDGETINFOASSUANTRANSACTION_H__
|
||||
|
||||
#include <interfaces/assuantransaction.h>
|
||||
#include "interfaces/assuantransaction.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
@ -200,6 +200,7 @@ GpgME::SignatureMode GpgME::CreatedSignature::mode() const
|
||||
case GPGME_SIG_MODE_DETACH: return Detached;
|
||||
case GPGME_SIG_MODE_CLEAR: return Clearsigned;
|
||||
case GPGME_SIG_MODE_ARCHIVE: return SignArchive; // cannot happen
|
||||
case GPGME_SIG_MODE_FILE: return SignFile; // cannot happen
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
#ifndef __GPGMEPP_STATUSCONSUMERASSUANTRANSACTION_H__
|
||||
#define __GPGMEPP_STATUSCONSUMERASSUANTRANSACTION_H__
|
||||
|
||||
#include <interfaces/assuantransaction.h>
|
||||
#include "interfaces/assuantransaction.h"
|
||||
|
||||
namespace GpgME
|
||||
{
|
||||
|
@ -27,7 +27,7 @@
|
||||
#define __GPGMEPP_TRUSTITEM_H__
|
||||
|
||||
#include "gpgmefw.h"
|
||||
#include <key.h>
|
||||
#include "key.h"
|
||||
#include "gpgmepp_export.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
@ -150,7 +150,7 @@ main (int argc, char **argv)
|
||||
const GpgME::Key key = ctx->key (*argv, err, only_secret);
|
||||
std::stringstream ss;
|
||||
|
||||
ss << "Key " << key << " Err: " << err.asString() << "\n";
|
||||
ss << "Key " << key << " Err: " << err.asStdString() << "\n";
|
||||
|
||||
std::cout << ss.str();
|
||||
|
||||
|
@ -153,14 +153,17 @@ main (int argc, char **argv)
|
||||
}
|
||||
Error err = ctx->startKeyListing (*argv, only_secret);
|
||||
if (err) {
|
||||
std::cout << "Error: " << err.asString() << "\n";
|
||||
std::cout << "Error: " << err.asStdString() << "\n";
|
||||
return -1;
|
||||
}
|
||||
GpgME::Key key;
|
||||
std::stringstream ss;
|
||||
do {
|
||||
key = ctx->nextKey(err);
|
||||
ss << key << "\n\n";
|
||||
if (!err)
|
||||
{
|
||||
ss << key << "\n\n";
|
||||
}
|
||||
} while (!err && !key.isNull());
|
||||
|
||||
std::cout << ss.str();
|
||||
|
@ -75,49 +75,52 @@ main (int argc, char **argv)
|
||||
Error err;
|
||||
auto ctx = std::unique_ptr<Context>{Context::createForEngine(AssuanEngine, &err)};
|
||||
if (!ctx) {
|
||||
std::cerr << "Failed to get context (Error: " << err.asString() << ")\n";
|
||||
std::cerr << "Failed to get context (Error: " << err.asStdString() << ")\n";
|
||||
return -1;
|
||||
}
|
||||
|
||||
const std::string dirmngrSocket = GpgME::dirInfo("dirmngr-socket");
|
||||
if ((err = ctx->setEngineFileName(dirmngrSocket.c_str()))) {
|
||||
std::cerr << "Failed to set engine file name (Error: " << err.asString() << ")\n";
|
||||
std::cerr << "Failed to set engine file name (Error: " << err.asStdString() << ")\n";
|
||||
return -1;
|
||||
}
|
||||
if ((err = ctx->setEngineHomeDirectory(""))) {
|
||||
std::cerr << "Failed to set engine home directory (Error: " << err.asString() << ")\n";
|
||||
std::cerr << "Failed to set engine home directory (Error: " << err.asStdString() << ")\n";
|
||||
return -1;
|
||||
}
|
||||
|
||||
// try do connect to dirmngr
|
||||
// try to connect to dirmngr
|
||||
err = ctx->assuanTransact("GETINFO version");
|
||||
if (err && err.code() != GPG_ERR_ASS_CONNECT_FAILED) {
|
||||
std::cerr << "Failed to start assuan transaction (Error: " << err.asString() << ")\n";
|
||||
std::cerr << "Failed to start assuan transaction (Error: " << err.asStdString() << ")\n";
|
||||
return -1;
|
||||
}
|
||||
if (err.code() == GPG_ERR_ASS_CONNECT_FAILED) {
|
||||
std::cerr << "Starting dirmngr ...\n";
|
||||
auto spawnCtx = std::unique_ptr<Context>{Context::createForEngine(SpawnEngine, &err)};
|
||||
if (!spawnCtx) {
|
||||
std::cerr << "Failed to get context for spawn engine (Error: " << err.asString() << ")\n";
|
||||
std::cerr << "Failed to get context for spawn engine (Error: " << err.asStdString() << ")\n";
|
||||
return -1;
|
||||
}
|
||||
|
||||
const auto dirmngrProgram = GpgME::dirInfo("dirmngr-name");
|
||||
const auto homedir = GpgME::dirInfo("homedir");
|
||||
const auto gpgconfProgram = GpgME::dirInfo("gpgconf-name");
|
||||
// replace backslashes with forward slashes in homedir to work around bug T6833
|
||||
std::string homedir{GpgME::dirInfo("homedir")};
|
||||
std::replace(homedir.begin(), homedir.end(), '\\', '/');
|
||||
const char *argv[] = {
|
||||
dirmngrProgram,
|
||||
gpgconfProgram,
|
||||
"--homedir",
|
||||
homedir,
|
||||
"--daemon",
|
||||
homedir.c_str(),
|
||||
"--launch",
|
||||
"dirmngr",
|
||||
NULL
|
||||
};
|
||||
auto ignoreIO = Data{Data::null};
|
||||
err = spawnCtx->spawnAsync(dirmngrProgram, argv,
|
||||
ignoreIO, ignoreIO, ignoreIO,
|
||||
Context::SpawnDetached);
|
||||
err = spawnCtx->spawn(gpgconfProgram, argv,
|
||||
ignoreIO, ignoreIO, ignoreIO,
|
||||
Context::SpawnDetached);
|
||||
if (err) {
|
||||
std::cerr << "Failed to start dirmngr (Error: " << err.asString() << ")\n";
|
||||
std::cerr << "Failed to start dirmngr (Error: " << err.asStdString() << ")\n";
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -134,7 +137,7 @@ main (int argc, char **argv)
|
||||
const auto cmd = std::string{"WKD_GET "} + email;
|
||||
err = ctx->assuanTransact(cmd.c_str());
|
||||
if (err && err.code() != GPG_ERR_NO_NAME && err.code() != GPG_ERR_NO_DATA) {
|
||||
std::cerr << "Error: WKD_GET returned " << err.asString() << "\n";
|
||||
std::cerr << "Error: WKD_GET returned " << err.asStdString() << "\n";
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -80,7 +80,7 @@ CLEANFILES = copystamp \
|
||||
# 'make distclean' clears the write bit, breaking rm -rf. Fix the
|
||||
# permissions.
|
||||
clean-local:
|
||||
rm -rf -- build
|
||||
rm -rf -- build dist gpg.egg-info
|
||||
for PYTHON in $(PYTHONS); do \
|
||||
find "$$(basename "$${PYTHON}")-gpg" -type d ! -perm -200 -exec chmod u+w {} ';' ; \
|
||||
rm -rf -- "$$(basename "$${PYTHON}")-gpg" ; \
|
||||
@ -101,8 +101,12 @@ install-exec-local:
|
||||
done
|
||||
|
||||
uninstall-local:
|
||||
set -x; GV=$$(echo $(VERSION) | tr - _); for PYTHON in $(PYTHONS); do \
|
||||
set -x; \
|
||||
GV=$$(echo $(VERSION) | tr - _); \
|
||||
normalizedGV=$$(echo $$GV | sed s/_beta/b/); \
|
||||
for PYTHON in $(PYTHONS); do \
|
||||
PLATLIB="$(prefix)/$$("$${PYTHON}" -c 'import sysconfig, os; print(os.path.relpath(sysconfig.get_path("platlib", scheme="posix_prefix"), sysconfig.get_config_var("prefix")))')" ; \
|
||||
rm -rf -- "$(DESTDIR)$${PLATLIB}/gpg" \
|
||||
"$(DESTDIR)$${PLATLIB}"/gpg-$$GV-py*.egg-info ; \
|
||||
"$(DESTDIR)$${PLATLIB}"/gpg-$$GV-py*.egg-info \
|
||||
"$(DESTDIR)$${PLATLIB}"/gpg-$$normalizedGV-py*.egg ; \
|
||||
done
|
||||
|
@ -2945,7 +2945,7 @@ Save that into a file called =keycount.pyx= and then create a
|
||||
=setup.py= file which contains this:
|
||||
|
||||
#+BEGIN_SRC python -i
|
||||
from distutils.core import setup
|
||||
from setuptools import setup
|
||||
from Cython.Build import cythonize
|
||||
|
||||
setup(
|
||||
|
@ -498,7 +498,7 @@
|
||||
% \def\foo{\parsearg\Xfoo}
|
||||
% \def\Xfoo#1{...}
|
||||
%
|
||||
% Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my
|
||||
% Actually, I use \csname\string\foo\endcsname, i.e. \\foo, as it is my
|
||||
% favourite TeX trick. --kasal, 16nov03
|
||||
|
||||
\def\parseargdef#1{%
|
||||
|
@ -21,7 +21,7 @@ from __future__ import absolute_import, division, unicode_literals
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License and the GNU
|
||||
# Lesser General Public along with this program; if not, see
|
||||
# Lesser General Public License along with this program; if not, see
|
||||
# <https://www.gnu.org/licenses/>.
|
||||
|
||||
import gpg
|
||||
|
@ -1,4 +1,4 @@
|
||||
from distutils.core import setup
|
||||
from setuptools import setup
|
||||
from Cython.Build import cythonize
|
||||
|
||||
setup(
|
||||
|
@ -21,7 +21,7 @@ from __future__ import absolute_import, division, unicode_literals
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License and the GNU
|
||||
# Lesser General Public along with this program; if not, see
|
||||
# Lesser General Public License along with this program; if not, see
|
||||
# <https://www.gnu.org/licenses/>.
|
||||
|
||||
import gpg
|
||||
|
@ -21,7 +21,7 @@ from __future__ import absolute_import, division, unicode_literals
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License and the GNU
|
||||
# Lesser General Public along with this program; if not, see
|
||||
# Lesser General Public License along with this program; if not, see
|
||||
# <https://www.gnu.org/licenses/>.
|
||||
|
||||
import gpg
|
||||
|
@ -21,7 +21,7 @@ from __future__ import absolute_import, division, unicode_literals
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License and the GNU
|
||||
# Lesser General Public along with this program; if not, see
|
||||
# Lesser General Public License along with this program; if not, see
|
||||
# <https://www.gnu.org/licenses/>.
|
||||
|
||||
import gpg
|
||||
|
@ -21,7 +21,7 @@ from __future__ import absolute_import, division, unicode_literals
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License and the GNU
|
||||
# Lesser General Public along with this program; if not, see
|
||||
# Lesser General Public License along with this program; if not, see
|
||||
# <https://www.gnu.org/licenses/>.
|
||||
|
||||
import gpg
|
||||
|
@ -24,7 +24,7 @@ import sys
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License and the GNU
|
||||
# Lesser General Public along with this program; if not, see
|
||||
# Lesser General Public License along with this program; if not, see
|
||||
# <https://www.gnu.org/licenses/>.
|
||||
|
||||
"""
|
||||
|
@ -24,7 +24,7 @@ import sys
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License and the GNU
|
||||
# Lesser General Public along with this program; if not, see
|
||||
# Lesser General Public License along with this program; if not, see
|
||||
# <https://www.gnu.org/licenses/>.
|
||||
|
||||
"""
|
||||
|
@ -25,7 +25,7 @@ from groups import group_lists
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License and the GNU
|
||||
# Lesser General Public along with this program; if not, see
|
||||
# Lesser General Public License along with this program; if not, see
|
||||
# <https://www.gnu.org/licenses/>.
|
||||
|
||||
"""
|
||||
|
@ -25,7 +25,7 @@ from groups import group_lists
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License and the GNU
|
||||
# Lesser General Public along with this program; if not, see
|
||||
# Lesser General Public License along with this program; if not, see
|
||||
# <https://www.gnu.org/licenses/>.
|
||||
|
||||
"""
|
||||
|
@ -25,7 +25,7 @@ from groups import group_lists
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License and the GNU
|
||||
# Lesser General Public along with this program; if not, see
|
||||
# Lesser General Public License along with this program; if not, see
|
||||
# <https://www.gnu.org/licenses/>.
|
||||
|
||||
"""
|
||||
|
@ -25,7 +25,7 @@ import sys
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License and the GNU
|
||||
# Lesser General Public along with this program; if not, see
|
||||
# Lesser General Public License along with this program; if not, see
|
||||
# <https://www.gnu.org/licenses/>.
|
||||
|
||||
print("""
|
||||
|
@ -25,7 +25,7 @@ import sys
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License and the GNU
|
||||
# Lesser General Public along with this program; if not, see
|
||||
# Lesser General Public License along with this program; if not, see
|
||||
# <https://www.gnu.org/licenses/>.
|
||||
|
||||
print("""
|
||||
|
@ -26,7 +26,7 @@ import sys
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License and the GNU
|
||||
# Lesser General Public along with this program; if not, see
|
||||
# Lesser General Public License along with this program; if not, see
|
||||
# <https://www.gnu.org/licenses/>.
|
||||
|
||||
print("""
|
||||
|
@ -27,7 +27,7 @@ import sys
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License and the GNU
|
||||
# Lesser General Public along with this program; if not, see
|
||||
# Lesser General Public License along with this program; if not, see
|
||||
# <https://www.gnu.org/licenses/>.
|
||||
|
||||
print("""
|
||||
|
@ -20,7 +20,7 @@ from __future__ import absolute_import, division, unicode_literals
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License and the GNU
|
||||
# Lesser General Public along with this program; if not, see
|
||||
# Lesser General Public License along with this program; if not, see
|
||||
# <https://www.gnu.org/licenses/>.
|
||||
|
||||
import subprocess
|
||||
|
@ -27,7 +27,7 @@ del absolute_import, division, unicode_literals
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License and the GNU
|
||||
# Lesser General Public along with this program; if not, see
|
||||
# Lesser General Public License along with this program; if not, see
|
||||
# <https://www.gnu.org/licenses/>.
|
||||
|
||||
print("""
|
||||
|
@ -25,7 +25,7 @@ import sys
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License and the GNU
|
||||
# Lesser General Public along with this program; if not, see
|
||||
# Lesser General Public License along with this program; if not, see
|
||||
# <https://www.gnu.org/licenses/>.
|
||||
|
||||
print("""
|
||||
|
@ -25,7 +25,7 @@ import sys
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License and the GNU
|
||||
# Lesser General Public along with this program; if not, see
|
||||
# Lesser General Public License along with this program; if not, see
|
||||
# <https://www.gnu.org/licenses/>.
|
||||
|
||||
print("""
|
||||
|
@ -25,7 +25,7 @@ import requests
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License and the GNU
|
||||
# Lesser General Public along with this program; if not, see
|
||||
# Lesser General Public License along with this program; if not, see
|
||||
# <https://www.gnu.org/licenses/>.
|
||||
|
||||
print("""
|
||||
|
@ -25,7 +25,7 @@ import sys
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License and the GNU
|
||||
# Lesser General Public along with this program; if not, see
|
||||
# Lesser General Public License along with this program; if not, see
|
||||
# <https://www.gnu.org/licenses/>.
|
||||
|
||||
print("""
|
||||
|
@ -21,7 +21,7 @@ from __future__ import absolute_import, division, unicode_literals
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License and the GNU
|
||||
# Lesser General Public along with this program; if not, see
|
||||
# Lesser General Public License along with this program; if not, see
|
||||
# <https://www.gnu.org/licenses/>.
|
||||
|
||||
import gpg
|
||||
|
@ -28,7 +28,7 @@ from groups import group_lists
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License and the GNU
|
||||
# Lesser General Public along with this program; if not, see
|
||||
# Lesser General Public License along with this program; if not, see
|
||||
# <https://www.gnu.org/licenses/>.
|
||||
|
||||
print("""
|
||||
|
@ -21,7 +21,7 @@ from __future__ import absolute_import, division, unicode_literals
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License and the GNU
|
||||
# Lesser General Public along with this program; if not, see
|
||||
# Lesser General Public License along with this program; if not, see
|
||||
# <https://www.gnu.org/licenses/>.
|
||||
|
||||
import sys
|
||||
|
@ -28,7 +28,7 @@ del absolute_import, division, unicode_literals
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License and the GNU
|
||||
# Lesser General Public along with this program; if not, see
|
||||
# Lesser General Public License along with this program; if not, see
|
||||
# <https://www.gnu.org/licenses/>.
|
||||
|
||||
print("""
|
||||
|
@ -28,7 +28,7 @@ del absolute_import, division, unicode_literals
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License and the GNU
|
||||
# Lesser General Public along with this program; if not, see
|
||||
# Lesser General Public License along with this program; if not, see
|
||||
# <https://www.gnu.org/licenses/>.
|
||||
|
||||
print("""
|
||||
|
@ -28,7 +28,7 @@ del absolute_import, division, unicode_literals
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License and the GNU
|
||||
# Lesser General Public along with this program; if not, see
|
||||
# Lesser General Public License along with this program; if not, see
|
||||
# <https://www.gnu.org/licenses/>.
|
||||
|
||||
print("""
|
||||
|
@ -27,7 +27,7 @@ del absolute_import, division, unicode_literals
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License and the GNU
|
||||
# Lesser General Public along with this program; if not, see
|
||||
# Lesser General Public License along with this program; if not, see
|
||||
# <https://www.gnu.org/licenses/>.
|
||||
|
||||
print("""
|
||||
|
@ -21,7 +21,7 @@ from __future__ import absolute_import, division, unicode_literals
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License and the GNU
|
||||
# Lesser General Public along with this program; if not, see
|
||||
# Lesser General Public License along with this program; if not, see
|
||||
# <https://www.gnu.org/licenses/>.
|
||||
|
||||
import gpg
|
||||
|
@ -26,7 +26,7 @@ import sys
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License and the GNU
|
||||
# Lesser General Public along with this program; if not, see
|
||||
# Lesser General Public License along with this program; if not, see
|
||||
# <https://www.gnu.org/licenses/>.
|
||||
|
||||
print("""
|
||||
|
@ -21,7 +21,7 @@ from __future__ import absolute_import, division, unicode_literals
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License and the GNU
|
||||
# Lesser General Public along with this program; if not, see
|
||||
# Lesser General Public License along with this program; if not, see
|
||||
# <https://www.gnu.org/licenses/>.
|
||||
|
||||
import gpg
|
||||
|
@ -21,7 +21,7 @@ from __future__ import absolute_import, division, unicode_literals
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License and the GNU
|
||||
# Lesser General Public along with this program; if not, see
|
||||
# Lesser General Public License along with this program; if not, see
|
||||
# <https://www.gnu.org/licenses/>.
|
||||
|
||||
import gpg
|
||||
|
@ -24,7 +24,7 @@ import sys
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License and the GNU
|
||||
# Lesser General Public along with this program; if not, see
|
||||
# Lesser General Public License along with this program; if not, see
|
||||
# <https://www.gnu.org/licenses/>.
|
||||
|
||||
"""
|
||||
|
@ -25,7 +25,7 @@ import sys
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License and the GNU
|
||||
# Lesser General Public along with this program; if not, see
|
||||
# Lesser General Public License along with this program; if not, see
|
||||
# <https://www.gnu.org/licenses/>.
|
||||
|
||||
intro = """
|
||||
|
@ -21,7 +21,7 @@ from __future__ import absolute_import, division, unicode_literals
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License and the GNU
|
||||
# Lesser General Public along with this program; if not, see
|
||||
# Lesser General Public License along with this program; if not, see
|
||||
# <https://www.gnu.org/licenses/>.
|
||||
|
||||
import gpg
|
||||
|
@ -21,7 +21,7 @@ from __future__ import absolute_import, division, unicode_literals
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License and the GNU
|
||||
# Lesser General Public along with this program; if not, see
|
||||
# Lesser General Public License along with this program; if not, see
|
||||
# <https://www.gnu.org/licenses/>.
|
||||
|
||||
import gpg
|
||||
|
@ -26,7 +26,7 @@
|
||||
%ignore HAVE_CXX11;
|
||||
|
||||
%{
|
||||
/* We use public symbols (eg. "_obsolete_class") which are marked as
|
||||
/* We use public symbols (e.g. "_obsolete_class") which are marked as
|
||||
* deprecated but we need to keep them. Silence the warning. */
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
%}
|
||||
|
@ -18,8 +18,12 @@
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
from distutils.core import setup, Extension
|
||||
from distutils.command.build import build
|
||||
try:
|
||||
from setuptools import setup, Extension
|
||||
from setuptools.command.build import build
|
||||
except ImportError:
|
||||
from distutils.core import setup, Extension
|
||||
from distutils.command.build import build
|
||||
|
||||
import glob
|
||||
import os
|
||||
@ -225,9 +229,8 @@ class BuildExtFirstHack(build):
|
||||
build.run(self)
|
||||
|
||||
|
||||
py3 = [] if sys.version_info.major < 3 else ['-py3']
|
||||
swig_sources = []
|
||||
swig_opts = ['-threads'] + py3 + extra_swig_opts
|
||||
swig_opts = ['-threads'] + extra_swig_opts
|
||||
swige = Extension(
|
||||
'gpg._gpgme',
|
||||
sources=swig_sources,
|
||||
@ -282,10 +285,12 @@ GPGME and these bindings is available here:
|
||||
'Programming Language :: Python :: 2',
|
||||
'Programming Language :: Python :: 2.7',
|
||||
'Programming Language :: Python :: 3',
|
||||
'Programming Language :: Python :: 3.4',
|
||||
'Programming Language :: Python :: 3.5',
|
||||
'Programming Language :: Python :: 3.6',
|
||||
'Programming Language :: Python :: 3.7',
|
||||
'Programming Language :: Python :: 3.8',
|
||||
'Programming Language :: Python :: 3.9',
|
||||
'Programming Language :: Python :: 3.10',
|
||||
'Programming Language :: Python :: 3.11',
|
||||
'Programming Language :: Python :: 3.12',
|
||||
'Operating System :: POSIX',
|
||||
'Operating System :: Microsoft :: Windows',
|
||||
'Topic :: Communications :: Email',
|
||||
|
@ -813,7 +813,7 @@ class Context(GpgmeWrapper):
|
||||
Keyword arguments:
|
||||
algorithm -- public key algorithm, see above (default: reasonable)
|
||||
expires_in -- expiration time in seconds (default: reasonable)
|
||||
expires -- whether or not the key should expire (default: True)
|
||||
expires -- whether the key should expire (default: True)
|
||||
sign -- request the signing capability (see above)
|
||||
encrypt -- request the encryption capability (see above)
|
||||
certify -- request the certification capability (see above)
|
||||
@ -901,7 +901,7 @@ class Context(GpgmeWrapper):
|
||||
Keyword arguments:
|
||||
algorithm -- public key algorithm, see above (default: reasonable)
|
||||
expires_in -- expiration time in seconds (default: reasonable)
|
||||
expires -- whether or not the subkey should expire (default: True)
|
||||
expires -- whether the subkey should expire (default: True)
|
||||
sign -- request the signing capability (see above)
|
||||
encrypt -- request the encryption capability (see above)
|
||||
authenticate -- request the authentication capability (see above)
|
||||
@ -1032,7 +1032,7 @@ class Context(GpgmeWrapper):
|
||||
|
||||
If command is a string or bytes, it will be used as-is. If it
|
||||
is an iterable of strings, it will be properly escaped and
|
||||
joined into an well-formed assuan command.
|
||||
joined into a well-formed assuan command.
|
||||
|
||||
Keyword arguments:
|
||||
data_cb -- a callback receiving data lines
|
||||
|
@ -88,7 +88,7 @@ with support.EphemeralContext() as ctx:
|
||||
except gpg.errors.GpgError:
|
||||
pass
|
||||
|
||||
# try to add an pre-existent UID
|
||||
# try to add a pre-existent UID
|
||||
try:
|
||||
ctx.key_add_uid(key, bravo)
|
||||
assert False, "Expected an error but got none"
|
||||
|
@ -1,22 +1,22 @@
|
||||
# Makefile.am for GPGMEPP.
|
||||
# Makefile.am - Makefile for QGpgME.
|
||||
# Copyright (C) 2016 Bundesamt für Sicherheit in der Informationstechnik
|
||||
# Software engineering by Intevation GmbH
|
||||
#
|
||||
# This file is part of GPGMEPP.
|
||||
# This file is part of QGpgME, the Qt API binding for GpgME.
|
||||
#
|
||||
# GPGME-CL is free software; you can redistribute it and/or modify it
|
||||
# QGpgME is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# GPGME-CL is distributed in the hope that it will be useful,
|
||||
# QGpgME is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Lesser General Public License for more details.
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this program; if not, see <https://gnu.org/licenses/>.
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, see <https://gnu.org/licenses/>.
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
if RUN_GPG_TESTS
|
||||
tests = tests
|
||||
|
@ -32,7 +32,7 @@ To use QGpgME first you need to obtain a Protocol class
|
||||
either for CMS (S/MIME) or OpenPGP. This Protocol class
|
||||
can then be used to create a Job.
|
||||
|
||||
Each Job can be started asynchronusly and emits a result
|
||||
Each Job can be started asynchronously and emits a result
|
||||
signal when done. The jobs are deleted automatically
|
||||
with QObject::deleteLater so they can be started without
|
||||
result handlers.
|
||||
@ -53,7 +53,7 @@ in the result signal.
|
||||
Jobs also provide progress signal whenever GnuPG emits
|
||||
a progress status line.
|
||||
|
||||
Most jobs also provide a way synchronusly execute them.
|
||||
Most jobs also provide a way synchronously execute them.
|
||||
Please not that synchronous use does not cause the autodeletion
|
||||
to take place so you have to manually delete them.
|
||||
|
||||
|
@ -1,21 +1,22 @@
|
||||
# Makefile.am - Makefile for GPGME Qt docs.
|
||||
# Makefile.am - Makefile for QGpgME docs.
|
||||
# Copyright (C) 2016 Bundesamt für Sicherheit in der Informationstechnik
|
||||
# Software engineering by Intevation GmbH
|
||||
#
|
||||
# This file is part of GPGME.
|
||||
# This file is part of QGpgME.
|
||||
#
|
||||
# GPGME is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU Lesser General Public License as
|
||||
# published by the Free Software Foundation; either version 2.1 of the
|
||||
# License, or (at your option) any later version.
|
||||
# QGpgME is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# GPGME is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
|
||||
# Public License for more details.
|
||||
# QGpgME is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this program; if not, see <https://www.gnu.org/licenses/>.
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, see <https://gnu.org/licenses/>.
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
|
@ -1,18 +1,18 @@
|
||||
# Makefile.am for GPGMEPP.
|
||||
# Makefile.am for QGpgME.
|
||||
# Copyright (C) 2016 Bundesamt für Sicherheit in der Informationstechnik
|
||||
# Software engineering by Intevation GmbH
|
||||
#
|
||||
# This file is part of GPGMEPP.
|
||||
# This file is part of QGpgME, the Qt API binding for GpgME.
|
||||
#
|
||||
# GPGME-CL is free software; you can redistribute it and/or modify it
|
||||
# QGpgME is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# GPGME-CL is distributed in the hope that it will be useful,
|
||||
# QGpgME is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Lesser General Public License for more details.
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
@ -20,11 +20,12 @@
|
||||
# 02111-1307, USA
|
||||
|
||||
if WANT_QT5
|
||||
lib_LTLIBRARIES = libqgpgme.la
|
||||
libqgpgme_la = libqgpgme.la
|
||||
endif
|
||||
if WANT_QT6
|
||||
lib_LTLIBRARIES = libqgpgmeqt6.la
|
||||
libqgpgmeqt6_la = libqgpgmeqt6.la
|
||||
endif
|
||||
lib_LTLIBRARIES = $(libqgpgme_la) $(libqgpgmeqt6_la)
|
||||
|
||||
EXTRA_DIST = QGpgmeConfig.cmake.in.in QGpgmeConfigVersion.cmake.in \
|
||||
qgpgme_debug.h qgpgme_version.h.in \
|
||||
@ -32,9 +33,11 @@ EXTRA_DIST = QGpgmeConfig.cmake.in.in QGpgmeConfigVersion.cmake.in \
|
||||
QGpgmeQt6Config-w32.cmake.in.in QGpgmeQt6ConfigVersion.cmake.in
|
||||
|
||||
qgpgme_sources = \
|
||||
cleaner.cpp \
|
||||
dataprovider.cpp \
|
||||
debug.cpp \
|
||||
decryptverifyarchivejob.cpp \
|
||||
decryptverifyjob.cpp \
|
||||
encryptarchivejob.cpp \
|
||||
filelistdataprovider.cpp \
|
||||
job.cpp multideletejob.cpp qgpgmeadduseridjob.cpp \
|
||||
@ -64,8 +67,11 @@ qgpgme_sources = \
|
||||
signarchivejob.cpp \
|
||||
signencryptjob.cpp \
|
||||
signencryptarchivejob.cpp \
|
||||
signjob.cpp \
|
||||
dn.cpp cryptoconfig.cpp wkdlookupresult.cpp \
|
||||
util.cpp \
|
||||
verifydetachedjob.cpp \
|
||||
verifyopaquejob.cpp \
|
||||
wkdrefreshjob.cpp
|
||||
|
||||
# If you add one here make sure that you also add one in camelcase
|
||||
@ -176,7 +182,9 @@ camelcase_headers= \
|
||||
|
||||
private_qgpgme_headers = \
|
||||
changeexpiryjob_p.h \
|
||||
cleaner.h \
|
||||
decryptverifyarchivejob_p.h \
|
||||
decryptverifyjob_p.h \
|
||||
encryptarchivejob_p.h \
|
||||
encryptjob_p.h \
|
||||
importjob_p.h \
|
||||
@ -224,8 +232,11 @@ private_qgpgme_headers = \
|
||||
signarchivejob_p.h \
|
||||
signencryptjob_p.h \
|
||||
signencryptarchivejob_p.h \
|
||||
signjob_p.h \
|
||||
threadedjobmixin.h \
|
||||
util.h \
|
||||
verifydetachedjob_p.h \
|
||||
verifyopaquejob_p.h \
|
||||
wkdrefreshjob_p.h
|
||||
|
||||
qgpgme_moc_sources = \
|
||||
@ -235,6 +246,7 @@ qgpgme_moc_sources = \
|
||||
changeexpiryjob.moc \
|
||||
changeownertrustjob.moc \
|
||||
changepasswdjob.moc \
|
||||
cleaner.moc \
|
||||
decryptjob.moc \
|
||||
decryptverifyarchivejob.moc \
|
||||
decryptverifyjob.moc \
|
||||
@ -308,33 +320,84 @@ qgpgme_moc_sources = \
|
||||
gpgcardjob.moc \
|
||||
qgpgmegpgcardjob.moc
|
||||
|
||||
qgpgmeincludedir = $(includedir)/qgpgme
|
||||
qgpgmeinclude_HEADERS = $(qgpgme_headers)
|
||||
camelcaseincludedir = $(includedir)/QGpgME
|
||||
camelcaseinclude_HEADERS = $(camelcase_headers)
|
||||
nodist_qgpgmeinclude_HEADERS = qgpgme_version.h
|
||||
if WANT_QT5
|
||||
includeprefix5 = qgpgme-qt5
|
||||
qgpgme5includedir = $(includedir)/$(includeprefix5)/qgpgme
|
||||
qgpgme5include_HEADERS = $(qgpgme_headers)
|
||||
nodist_qgpgme5include_HEADERS = qgpgme_version.h
|
||||
camelcase5includedir = $(includedir)/$(includeprefix5)/QGpgME
|
||||
nodist_camelcase5include_HEADERS = $(camelcase_headers)
|
||||
endif
|
||||
if WANT_QT6
|
||||
includeprefix6 = qgpgme-qt6
|
||||
qgpgme6includedir = $(includedir)/$(includeprefix6)/qgpgme
|
||||
qgpgme6include_HEADERS = $(qgpgme_headers)
|
||||
nodist_qgpgme6include_HEADERS = qgpgme_version.h
|
||||
camelcase6includedir = $(includedir)/$(includeprefix6)/QGpgME
|
||||
nodist_camelcase6include_HEADERS = $(camelcase_headers)
|
||||
endif
|
||||
|
||||
# generate the moc files in two steps:
|
||||
# 1. generate Qt 5/6-specific moc files in builddir with extension .moc5/.moc6;
|
||||
# this ensures correct dependencies on the source files
|
||||
# 2. generate forwarding headers in subfolders moc5/moc6 with extension .moc;
|
||||
# this ensures that the "foo.moc" includes in the source files work and
|
||||
# include the correct version of the generated moc files for Qt 5/6
|
||||
# GNU make's pattern rules would make this easier, but we don't want to use them
|
||||
if WANT_QT5
|
||||
moc5_dir = moc5
|
||||
qgpgme_moc5_sources = $(qgpgme_moc_sources:%.moc=%.moc5)
|
||||
qgpgme_moc5_forward_headers = $(qgpgme_moc_sources:%=$(moc5_dir)/%)
|
||||
|
||||
.h.moc5:
|
||||
$(MOC5) `test -f '$<' || echo '$(srcdir)/'`$< -o $@
|
||||
|
||||
$(moc5_dir):
|
||||
mkdir $(moc5_dir)
|
||||
|
||||
$(qgpgme_moc5_forward_headers): Makefile.am | $(moc5_dir)
|
||||
echo "#include \"../$(notdir $@)5\"" > "$@"
|
||||
endif
|
||||
if WANT_QT6
|
||||
moc6_dir = moc6
|
||||
qgpgme_moc6_sources = $(qgpgme_moc_sources:%.moc=%.moc6)
|
||||
qgpgme_moc6_forward_headers = $(qgpgme_moc_sources:%=$(moc6_dir)/%)
|
||||
|
||||
.h.moc6:
|
||||
$(MOC6) `test -f '$<' || echo '$(srcdir)/'`$< -o $@
|
||||
|
||||
$(moc6_dir):
|
||||
mkdir $(moc6_dir)
|
||||
|
||||
$(qgpgme_moc6_forward_headers): Makefile.am | $(moc6_dir)
|
||||
echo "#include \"../$(notdir $@)6\"" > "$@"
|
||||
endif
|
||||
|
||||
if WANT_QT5
|
||||
AM_CPPFLAGS = -I$(top_srcdir)/lang/cpp/src -I$(top_builddir)/src \
|
||||
libqgpgme_la_CPPFLAGS = -I./moc5 -I$(top_builddir)/lang/cpp/src -I$(top_builddir)/src \
|
||||
@GPGME_QT5_CFLAGS@ @GPG_ERROR_CFLAGS@ @LIBASSUAN_CFLAGS@ \
|
||||
-DBUILDING_QGPGME -Wsuggest-override \
|
||||
-Wzero-as-null-pointer-constant
|
||||
|
||||
libqgpgme_la_SOURCES = $(qgpgme_sources) $(qgpgme_headers) $(private_qgpgme_headers)
|
||||
|
||||
nodist_libqgpgme_la_SOURCES = $(qgpgme_moc5_sources) $(qgpgme_moc5_forward_headers)
|
||||
|
||||
libqgpgme_la_LIBADD = ../../cpp/src/libgpgmepp.la ../../../src/libgpgme.la \
|
||||
@LIBASSUAN_LIBS@ @GPG_ERROR_LIBS@ @GPGME_QT5_LIBS@
|
||||
libqgpgme_la_LDFLAGS = -no-undefined -version-info \
|
||||
@LIBQGPGME_LT_CURRENT@:@LIBQGPGME_LT_REVISION@:@LIBQGPGME_LT_AGE@
|
||||
endif
|
||||
if WANT_QT6
|
||||
AM_CPPFLAGS = -I$(top_srcdir)/lang/cpp/src -I$(top_builddir)/src \
|
||||
libqgpgmeqt6_la_CPPFLAGS = -I./moc6 -I$(top_builddir)/lang/cpp/src -I$(top_builddir)/src \
|
||||
@GPGME_QT6_CFLAGS@ @GPG_ERROR_CFLAGS@ @LIBASSUAN_CFLAGS@ \
|
||||
-DBUILDING_QGPGME -Wsuggest-override \
|
||||
-Wzero-as-null-pointer-constant
|
||||
|
||||
libqgpgmeqt6_la_SOURCES = $(qgpgme_sources) $(qgpgme_headers) $(private_qgpgme_headers)
|
||||
|
||||
nodist_libqgpgmeqt6_la_SOURCES = $(qgpgme_moc6_sources) $(qgpgme_moc6_forward_headers)
|
||||
|
||||
libqgpgmeqt6_la_LIBADD = ../../cpp/src/libgpgmepp.la ../../../src/libgpgme.la \
|
||||
@LIBASSUAN_LIBS@ @GPG_ERROR_LIBS@ @GPGME_QT6_LIBS@
|
||||
libqgpgmeqt6_la_LDFLAGS = -no-undefined -version-info \
|
||||
@ -352,12 +415,12 @@ if HAVE_W32_SYSTEM
|
||||
QGpgmeConfig.cmake: QGpgmeConfig-w32.cmake.in
|
||||
sed -e 's|[@]resolved_bindir@|$(bindir)|g' < "$<" | \
|
||||
sed -e 's|[@]resolved_libdir@|$(libdir)|g' | \
|
||||
sed -e 's|[@]resolved_includedir@|$(includedir)|g' > $@
|
||||
sed -e 's|[@]resolved_includedir@|$(includedir)/$(includeprefix5)|g' > $@
|
||||
else
|
||||
QGpgmeConfig.cmake: QGpgmeConfig.cmake.in
|
||||
sed -e 's|[@]resolved_libdir@|$(libdir)|g' < "$<" | \
|
||||
sed -e 's|[@]libsuffix@|$(libsuffix)|g' | \
|
||||
sed -e 's|[@]resolved_includedir@|$(includedir)|g' > $@
|
||||
sed -e 's|[@]resolved_includedir@|$(includedir)/$(includeprefix5)|g' > $@
|
||||
endif
|
||||
endif
|
||||
if WANT_QT6
|
||||
@ -365,12 +428,12 @@ if HAVE_W32_SYSTEM
|
||||
QGpgmeQt6Config.cmake: QGpgmeQt6Config-w32.cmake.in
|
||||
sed -e 's|[@]resolved_bindir@|$(bindir)|g' < "$<" | \
|
||||
sed -e 's|[@]resolved_libdir@|$(libdir)|g' | \
|
||||
sed -e 's|[@]resolved_includedir@|$(includedir)|g' > $@
|
||||
sed -e 's|[@]resolved_includedir@|$(includedir)/$(includeprefix6)|g' > $@
|
||||
else
|
||||
QGpgmeQt6Config.cmake: QGpgmeQt6Config.cmake.in
|
||||
sed -e 's|[@]resolved_libdir@|$(libdir)|g' < "$<" | \
|
||||
sed -e 's|[@]libsuffix@|$(libsuffix)|g' | \
|
||||
sed -e 's|[@]resolved_includedir@|$(includedir)|g' > $@
|
||||
sed -e 's|[@]resolved_includedir@|$(includedir)/$(includeprefix6)|g' > $@
|
||||
endif
|
||||
endif
|
||||
|
||||
@ -380,50 +443,65 @@ $(camelcase_headers): Makefile.am
|
||||
echo ".h\"" >> "$@"
|
||||
|
||||
if WANT_QT5
|
||||
install-cmake-files: QGpgmeConfig.cmake QGpgmeConfigVersion.cmake
|
||||
install-cmake-files-qt5: QGpgmeConfig.cmake QGpgmeConfigVersion.cmake
|
||||
-$(INSTALL) -d $(DESTDIR)$(libdir)/cmake/QGpgme
|
||||
$(INSTALL) -m 644 QGpgmeConfig.cmake \
|
||||
$(DESTDIR)$(libdir)/cmake/QGpgme/QGpgmeConfig.cmake
|
||||
$(INSTALL) -m 644 QGpgmeConfigVersion.cmake \
|
||||
$(DESTDIR)$(libdir)/cmake/QGpgme/QGpgmeConfigVersion.cmake
|
||||
install_cmake_files_qt5 = install-cmake-files-qt5
|
||||
|
||||
uninstall-cmake-files:
|
||||
uninstall-cmake-files-qt5:
|
||||
-rm $(DESTDIR)$(libdir)/cmake/QGpgme/QGpgmeConfigVersion.cmake
|
||||
-rm $(DESTDIR)$(libdir)/cmake/QGpgme/QGpgmeConfig.cmake
|
||||
-rmdir $(DESTDIR)$(libdir)/cmake/QGpgme/
|
||||
uninstall_cmake_files_qt5 = uninstall-cmake-files-qt5
|
||||
|
||||
uninstall-include-dirs-qt5:
|
||||
-rmdir $(DESTDIR)$(qgpgme5includedir)
|
||||
-rmdir $(DESTDIR)$(camelcase5includedir)
|
||||
-rmdir $(DESTDIR)$(includedir)/$(includeprefix5)
|
||||
uninstall_include_dirs_qt5 = uninstall-include-dirs-qt5
|
||||
endif
|
||||
if WANT_QT6
|
||||
install-cmake-files: QGpgmeQt6Config.cmake QGpgmeQt6ConfigVersion.cmake
|
||||
install-cmake-files-qt6: QGpgmeQt6Config.cmake QGpgmeQt6ConfigVersion.cmake
|
||||
-$(INSTALL) -d $(DESTDIR)$(libdir)/cmake/QGpgmeQt6
|
||||
$(INSTALL) -m 644 QGpgmeQt6Config.cmake \
|
||||
$(DESTDIR)$(libdir)/cmake/QGpgmeQt6/QGpgmeQt6Config.cmake
|
||||
$(INSTALL) -m 644 QGpgmeQt6ConfigVersion.cmake \
|
||||
$(DESTDIR)$(libdir)/cmake/QGpgmeQt6/QGpgmeQt6ConfigVersion.cmake
|
||||
install_cmake_files_qt6 = install-cmake-files-qt6
|
||||
|
||||
uninstall-cmake-files:
|
||||
uninstall-cmake-files-qt6:
|
||||
-rm $(DESTDIR)$(libdir)/cmake/QGpgmeQt6/QGpgmeQt6ConfigVersion.cmake
|
||||
-rm $(DESTDIR)$(libdir)/cmake/QGpgmeQt6/QGpgmeQt6Config.cmake
|
||||
-rmdir $(DESTDIR)$(libdir)/cmake/QGpgmeQt6/
|
||||
uninstall_cmake_files_qt6 = uninstall-cmake-files-qt6
|
||||
|
||||
uninstall-include-dirs-qt6:
|
||||
-rmdir $(DESTDIR)$(qgpgme6includedir)
|
||||
-rmdir $(DESTDIR)$(camelcase6includedir)
|
||||
-rmdir $(DESTDIR)$(includedir)/$(includeprefix6)
|
||||
uninstall_include_dirs_qt6 = uninstall-include-dirs-qt6
|
||||
endif
|
||||
|
||||
install-data-local: install-cmake-files
|
||||
install-data-local: $(install_cmake_files_qt5) $(install_cmake_files_qt6)
|
||||
|
||||
uninstall-local: uninstall-cmake-files
|
||||
uninstall-hook: $(uninstall_cmake_files_qt5) $(uninstall_cmake_files_qt6) \
|
||||
$(uninstall_include_dirs_qt5) $(uninstall_include_dirs_qt6)
|
||||
|
||||
BUILT_SOURCES = $(qgpgme_moc_sources) $(camelcase_headers)
|
||||
BUILT_SOURCES = $(qgpgme_moc5_sources) $(qgpgme_moc5_forward_headers) \
|
||||
$(qgpgme_moc6_sources) $(qgpgme_moc6_forward_headers) \
|
||||
$(camelcase_headers)
|
||||
|
||||
CLEANFILES = $(qgpgme_moc_sources) $(camelcase_headers) QGpgmeConfig.cmake \
|
||||
CLEANFILES = $(qgpgme_moc5_sources) $(qgpgme_moc5_forward_headers) \
|
||||
$(qgpgme_moc6_sources) $(qgpgme_moc6_forward_headers) \
|
||||
$(camelcase_headers) QGpgmeConfig.cmake \
|
||||
qgpgme_version.h QGpgmeConfig.cmake.in \
|
||||
QGpgmeConfig-w32.cmake.in QGpgmeConfigVersion.cmake \
|
||||
QGpgmeQt6Config.cmake.in QGpgmeQt6Config-w32.cmake.in \
|
||||
QGpgmeQt6Config.cmake QGpgmeQt6ConfigVersion.cmake
|
||||
|
||||
if WANT_QT5
|
||||
nodist_libqgpgme_la_SOURCES = $(qgpgme_moc_sources)
|
||||
endif
|
||||
if WANT_QT6
|
||||
nodist_libqgpgmeqt6_la_SOURCES = $(qgpgme_moc_sources)
|
||||
endif
|
||||
|
||||
.h.moc:
|
||||
$(MOC) `test -f '$<' || echo '$(srcdir)/'`$< -o $@
|
||||
clean-local:
|
||||
-test -z "$(moc5_dir)" || rm -rf $(moc5_dir)
|
||||
-test -z "$(moc6_dir)" || rm -rf $(moc6_dir)
|
||||
|
@ -1,17 +1,17 @@
|
||||
# CMake Config file for QGPGME.
|
||||
# Copyright (C) 2016 Intevation GmbH
|
||||
#
|
||||
# This file is part of GPGME.
|
||||
# This file is part of QGpgME.
|
||||
#
|
||||
# GPGME-CL is free software; you can redistribute it and/or modify it
|
||||
# QGpgME is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# GPGME-CL is distributed in the hope that it will be useful,
|
||||
# QGpgME is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Lesser General Public License for more details.
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
|
@ -1,17 +1,17 @@
|
||||
# CMake Config file for QGPGME.
|
||||
# Copyright (C) 2016 Intevation GmbH
|
||||
#
|
||||
# This file is part of GPGME.
|
||||
# This file is part of QGpgME.
|
||||
#
|
||||
# GPGME-CL is free software; you can redistribute it and/or modify it
|
||||
# QGpgME is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# GPGME-CL is distributed in the hope that it will be useful,
|
||||
# QGpgME is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Lesser General Public License for more details.
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
|
@ -1,17 +1,17 @@
|
||||
# CMake Version file for QGPGME.
|
||||
# Copyright (C) 2016 Intevation GmbH
|
||||
#
|
||||
# This file is part of GPGME.
|
||||
# This file is part of QGpgME.
|
||||
#
|
||||
# GPGME-CL is free software; you can redistribute it and/or modify it
|
||||
# QGpgME is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# GPGME-CL is distributed in the hope that it will be useful,
|
||||
# QGpgME is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Lesser General Public License for more details.
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
|
@ -1,7 +1,7 @@
|
||||
# CMake Config file for QGpgME for Qt 6
|
||||
# Copyright (C) 2016 Intevation GmbH
|
||||
#
|
||||
# This file is part of GPGME.
|
||||
# This file is part of QGpgME.
|
||||
#
|
||||
# QGpgME is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
@ -11,7 +11,7 @@
|
||||
# QGpgME is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Lesser General Public License for more details.
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
|
@ -1,7 +1,7 @@
|
||||
# CMake Config file for QGpgME for Qt 6
|
||||
# Copyright (C) 2016 Intevation GmbH
|
||||
#
|
||||
# This file is part of GPGME.
|
||||
# This file is part of QGpgME.
|
||||
#
|
||||
# QGpgME is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
@ -11,7 +11,7 @@
|
||||
# QGpgME is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Lesser General Public License for more details.
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
|
@ -1,7 +1,7 @@
|
||||
# CMake Version file for QGpgME for Qt 6
|
||||
# Copyright (C) 2016 Intevation GmbH
|
||||
#
|
||||
# This file is part of GPGME.
|
||||
# This file is part of QGpgME.
|
||||
#
|
||||
# QGpgME is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
@ -11,7 +11,7 @@
|
||||
# QGpgME is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Lesser General Public License for more details.
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
|
@ -38,7 +38,7 @@
|
||||
#include "changeexpiryjob.h"
|
||||
#include "changeexpiryjob_p.h"
|
||||
|
||||
#include <context.h>
|
||||
#include <gpgme++/context.h>
|
||||
|
||||
using namespace GpgME;
|
||||
using namespace QGpgME;
|
||||
|
@ -37,11 +37,7 @@
|
||||
|
||||
#include "job.h"
|
||||
|
||||
#ifdef BUILDING_QGPGME
|
||||
# include "key.h"
|
||||
#else
|
||||
# include <gpgme++/key.h>
|
||||
#endif
|
||||
#include <gpgme++/key.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
|
@ -37,11 +37,7 @@
|
||||
|
||||
#include "job.h"
|
||||
|
||||
#ifdef BUILDING_QGPGME
|
||||
# include "key.h"
|
||||
#else
|
||||
# include <gpgme++/key.h>
|
||||
#endif
|
||||
#include <gpgme++/key.h>
|
||||
|
||||
namespace QGpgME
|
||||
{
|
||||
|
99
lang/qt/src/cleaner.cpp
Normal file
99
lang/qt/src/cleaner.cpp
Normal file
@ -0,0 +1,99 @@
|
||||
/*
|
||||
cleaner.cpp
|
||||
|
||||
This file is part of qgpgme, the Qt API binding for gpgme
|
||||
Copyright (c) 2023 g10 Code GmbH
|
||||
Software engineering by Ingo Klöcker <dev@ingo-kloecker.de>
|
||||
|
||||
QGpgME is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
QGpgME is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
In addition, as a special exception, the copyright holders give
|
||||
permission to link the code of this program with any edition of
|
||||
the Qt library by Trolltech AS, Norway (or with modified versions
|
||||
of Qt that use the same license as Qt), and distribute linked
|
||||
combinations including the two. You must obey the GNU General
|
||||
Public License in all respects for all of the code used other than
|
||||
Qt. If you modify this file, you may extend this exception to
|
||||
your version of the file, but you are not obligated to do so. If
|
||||
you do not wish to do so, delete this exception statement from
|
||||
your version.
|
||||
*/
|
||||
|
||||
#include "cleaner.h"
|
||||
|
||||
#include <qgpgme_debug.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QFile>
|
||||
|
||||
#include <chrono>
|
||||
|
||||
static const auto timeout = std::chrono::seconds{10};
|
||||
|
||||
static bool remove_file(const QString &filePath)
|
||||
{
|
||||
if (filePath.isEmpty()) {
|
||||
qCWarning(QGPGME_LOG) << __func__ << "- called with empty file path";
|
||||
return true;
|
||||
}
|
||||
if (QFile::exists(filePath)) {
|
||||
qCDebug(QGPGME_LOG) << __func__ << "- Removing file" << filePath;
|
||||
if (!QFile::remove(filePath)) {
|
||||
qCDebug(QGPGME_LOG) << __func__ << "- Removing file" << filePath << "failed";
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
qCDebug(QGPGME_LOG) << __func__ << "- File" << filePath << "doesn't exist";
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void Cleaner::removeFile(const QString &filePath)
|
||||
{
|
||||
if (!remove_file(filePath)) {
|
||||
// use invokeMethod because we might not be called from the GUI thread
|
||||
// but we want to delegate the Cleaner's clean-up to the application instance
|
||||
QMetaObject::invokeMethod(qApp, [filePath]() {
|
||||
new Cleaner{filePath, qApp};
|
||||
}, Qt::QueuedConnection);
|
||||
}
|
||||
}
|
||||
|
||||
Cleaner::Cleaner(const QString &filePath, QObject *parent)
|
||||
: QObject{parent}
|
||||
, mFilePath{filePath}
|
||||
{
|
||||
qCDebug(QGPGME_LOG) << this << __func__ << filePath;
|
||||
mTimer.setSingleShot(true);
|
||||
mTimer.callOnTimeout([this]() {
|
||||
if (remove_file(mFilePath)) {
|
||||
mFilePath.clear();
|
||||
deleteLater();
|
||||
} else {
|
||||
mTimer.start(timeout);
|
||||
}
|
||||
});
|
||||
mTimer.start(timeout);
|
||||
}
|
||||
|
||||
Cleaner::~Cleaner()
|
||||
{
|
||||
qCDebug(QGPGME_LOG) << this << __func__;
|
||||
if (!mFilePath.isEmpty()) {
|
||||
remove_file(mFilePath);
|
||||
}
|
||||
}
|
||||
|
||||
#include "cleaner.moc"
|
60
lang/qt/src/cleaner.h
Normal file
60
lang/qt/src/cleaner.h
Normal file
@ -0,0 +1,60 @@
|
||||
/*
|
||||
cleaner.h
|
||||
|
||||
This file is part of qgpgme, the Qt API binding for gpgme
|
||||
Copyright (c) 2023 g10 Code GmbH
|
||||
Software engineering by Ingo Klöcker <dev@ingo-kloecker.de>
|
||||
|
||||
QGpgME is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
QGpgME is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
In addition, as a special exception, the copyright holders give
|
||||
permission to link the code of this program with any edition of
|
||||
the Qt library by Trolltech AS, Norway (or with modified versions
|
||||
of Qt that use the same license as Qt), and distribute linked
|
||||
combinations including the two. You must obey the GNU General
|
||||
Public License in all respects for all of the code used other than
|
||||
Qt. If you modify this file, you may extend this exception to
|
||||
your version of the file, but you are not obligated to do so. If
|
||||
you do not wish to do so, delete this exception statement from
|
||||
your version.
|
||||
*/
|
||||
|
||||
#ifndef __QGPGME_CLEANER_H__
|
||||
#define __QGPGME_CLEANER_H__
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <QTimer>
|
||||
|
||||
/** Helper class that tries to remove files at regular intervals and on destruction. */
|
||||
class Cleaner : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
/** Tries to remove the file. If this fails it creates a Cleaner for the file. */
|
||||
static void removeFile(const QString &filePath);
|
||||
|
||||
private:
|
||||
explicit Cleaner(const QString &filePath, QObject *parent=nullptr);
|
||||
~Cleaner() override;
|
||||
|
||||
Q_DISABLE_COPY_MOVE(Cleaner)
|
||||
|
||||
private:
|
||||
QString mFilePath;
|
||||
QTimer mTimer;
|
||||
};
|
||||
|
||||
#endif // __QGPGME_CLEANER_H__
|
@ -1,24 +1,24 @@
|
||||
/* dataprovider.cpp
|
||||
Copyright (C) 2004 Klarävdalens Datakonsult AB
|
||||
|
||||
This file is part of qgpgme, the Qt API binding for gpgme
|
||||
Copyright (C) 2004 Klarävdalens Datakonsult AB
|
||||
Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
|
||||
Software engineering by Intevation GmbH
|
||||
|
||||
This file is part of QGPGME.
|
||||
QGpgME is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
QGPGME is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library General Public License as published
|
||||
by the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
QGpgME is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
QGPGME is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with QGPGME; see the file COPYING.LIB. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
// -*- c++ -*-
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
|
||||
#include <dataprovider.h>
|
||||
|
||||
#include <error.h>
|
||||
#include <gpgme++/error.h>
|
||||
|
||||
#include <QIODevice>
|
||||
#include <QProcess>
|
||||
|
@ -1,24 +1,24 @@
|
||||
/* dataprovider.h
|
||||
Copyright (C) 2004 Klarälvdalens Datakonsult AB
|
||||
|
||||
This file is part of qgpgme, the Qt API binding for gpgme
|
||||
Copyright (C) 2004 Klarälvdalens Datakonsult AB
|
||||
Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
|
||||
Software engineering by Intevation GmbH
|
||||
|
||||
This file is part of QGPGME.
|
||||
QGpgME is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
QGPGME is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library General Public License as published
|
||||
by the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
QGpgME is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
QGPGME is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with QGPGME; see the file COPYING.LIB. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
// -*- c++ -*-
|
||||
#ifndef __QGPGME_DATAPROVIDER_H__
|
||||
@ -26,11 +26,7 @@
|
||||
|
||||
#include "qgpgme_export.h"
|
||||
|
||||
#ifdef BUILDING_QGPGME
|
||||
#include <interfaces/dataprovider.h>
|
||||
#else
|
||||
#include <gpgme++/interfaces/dataprovider.h>
|
||||
#endif
|
||||
|
||||
#include <memory>
|
||||
|
||||
|
@ -35,15 +35,21 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "error.h"
|
||||
#include <gpgme++/error.h>
|
||||
#include "debug.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
QDebug operator<<(QDebug debug, const GpgME::Error &err)
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
// On Windows, we tell libgpg-error to return (translated) error messages as UTF-8
|
||||
const auto errAsString = QString::fromStdString(err.asStdString());
|
||||
#else
|
||||
const auto errAsString = QString::fromLocal8Bit(err.asStdString().c_str());
|
||||
#endif
|
||||
const bool oldSetting = debug.autoInsertSpaces();
|
||||
debug.nospace() << err.asString() << " (code: " << err.code() << ", source: " << err.source() << ")";
|
||||
debug.nospace() << errAsString << " (code: " << err.code() << ", source: " << err.source() << ")";
|
||||
debug.setAutoInsertSpaces(oldSetting);
|
||||
return debug.maybeSpace();
|
||||
}
|
||||
|
@ -38,7 +38,7 @@
|
||||
#include "decryptverifyarchivejob.h"
|
||||
#include "decryptverifyarchivejob_p.h"
|
||||
|
||||
#include <engineinfo.h>
|
||||
#include <gpgme++/engineinfo.h>
|
||||
|
||||
using namespace QGpgME;
|
||||
|
||||
|
@ -36,11 +36,7 @@
|
||||
|
||||
#include "job.h"
|
||||
|
||||
#ifdef BUILDING_QGPGME
|
||||
# include "context.h"
|
||||
#else
|
||||
# include <gpgme++/context.h>
|
||||
#endif
|
||||
#include <gpgme++/context.h>
|
||||
|
||||
namespace GpgME
|
||||
{
|
||||
|
74
lang/qt/src/decryptverifyjob.cpp
Normal file
74
lang/qt/src/decryptverifyjob.cpp
Normal file
@ -0,0 +1,74 @@
|
||||
/*
|
||||
decryptverifyjob.cpp
|
||||
|
||||
This file is part of qgpgme, the Qt API binding for gpgme
|
||||
Copyright (c) 2023 g10 Code GmbH
|
||||
Software engineering by Ingo Klöcker <dev@ingo-kloecker.de>
|
||||
|
||||
QGpgME is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
QGpgME is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
In addition, as a special exception, the copyright holders give
|
||||
permission to link the code of this program with any edition of
|
||||
the Qt library by Trolltech AS, Norway (or with modified versions
|
||||
of Qt that use the same license as Qt), and distribute linked
|
||||
combinations including the two. You must obey the GNU General
|
||||
Public License in all respects for all of the code used other than
|
||||
Qt. If you modify this file, you may extend this exception to
|
||||
your version of the file, but you are not obligated to do so. If
|
||||
you do not wish to do so, delete this exception statement from
|
||||
your version.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "decryptverifyjob.h"
|
||||
#include "decryptverifyjob_p.h"
|
||||
|
||||
using namespace QGpgME;
|
||||
|
||||
DecryptVerifyJob::DecryptVerifyJob(QObject *parent)
|
||||
: Job{parent}
|
||||
{
|
||||
}
|
||||
|
||||
DecryptVerifyJob::~DecryptVerifyJob() = default;
|
||||
|
||||
void DecryptVerifyJob::setInputFile(const QString &path)
|
||||
{
|
||||
auto d = jobPrivate<DecryptVerifyJobPrivate>(this);
|
||||
d->m_inputFilePath = path;
|
||||
}
|
||||
|
||||
QString DecryptVerifyJob::inputFile() const
|
||||
{
|
||||
auto d = jobPrivate<DecryptVerifyJobPrivate>(this);
|
||||
return d->m_inputFilePath;
|
||||
}
|
||||
|
||||
void DecryptVerifyJob::setOutputFile(const QString &path)
|
||||
{
|
||||
auto d = jobPrivate<DecryptVerifyJobPrivate>(this);
|
||||
d->m_outputFilePath = path;
|
||||
}
|
||||
|
||||
QString DecryptVerifyJob::outputFile() const
|
||||
{
|
||||
auto d = jobPrivate<DecryptVerifyJobPrivate>(this);
|
||||
return d->m_outputFilePath;
|
||||
}
|
||||
|
||||
#include "decryptverifyjob.moc"
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user