├── .gitattributes ├── tests ├── fixture │ ├── gpg.conf │ └── gpg-agent.conf ├── fixture.qrc ├── run-keyformailboxjob.cpp └── run-receivekeysjob.cpp ├── .gitignore ├── src ├── qgpgme_debug.h ├── qgpgme_debug.cpp ├── QGpgmeConfig.cmake.in ├── exportjob.cpp ├── decryptjob.cpp ├── gpgcardjob.cpp ├── keylistjob.cpp ├── signkeyjob.cpp ├── specialjob.cpp ├── downloadjob.cpp ├── adduseridjob.cpp ├── revokekeyjob.cpp ├── wkdlookupjob.cpp ├── tofupolicyjob.cpp ├── wkspublishjob.cpp ├── refreshkeysjob.cpp ├── changepasswdjob.cpp ├── receivekeysjob.cpp ├── keyformailboxjob.cpp ├── keygenerationjob.cpp ├── abstractimportjob_p.h ├── changeownertrustjob.cpp ├── setprimaryuseridjob.cpp ├── addexistingsubkeyjob.cpp ├── importfromkeyserverjob.cpp ├── deletejob_p.h ├── listallkeysjob_p.h ├── verifyopaquejob_p.h ├── changeexpiryjob_p.h ├── decryptverifyjob_p.h ├── verifydetachedjob_p.h ├── wkdrefreshjob_p.h ├── signarchivejob_p.h ├── deletejob.cpp ├── decryptverifyarchivejob_p.h ├── abstractimportjob.cpp ├── importjob_p.h ├── signjob_p.h ├── encryptarchivejob_p.h ├── qt6compat_p.h ├── debug.h ├── signencryptarchivejob_p.h ├── signencryptjob_p.h ├── encryptjob_p.h ├── listallkeysjob.cpp ├── cleaner.h ├── qgpgmegpgcardjob.h ├── debug.cpp ├── wkdrefreshjob.cpp ├── qgpgmesetprimaryuseridjob.h ├── qgpgmechangepasswdjob.h ├── qgpgmetofupolicyjob.h ├── qgpgmeadduseridjob.h ├── setprimaryuseridjob.h ├── abstractimportjob.h ├── qgpgmewkdrefreshjob.h ├── qgpgmechangeownertrustjob.h ├── qgpgmereceivekeysjob.h ├── receivekeysjob.h ├── quickjob_p.h ├── qgpgmewkdlookupjob.h ├── changeexpiryjob.cpp ├── qgpgmeaddexistingsubkeyjob.h ├── gpgcardjob.h ├── qgpgmedeletejob.h ├── qgpgmekeygenerationjob.h ├── qgpgmewkspublishjob.h ├── wkdlookupjob.h ├── qgpgmedownloadjob.h ├── qgpgmetofupolicyjob.cpp ├── tofupolicyjob.h ├── qgpgmerevokekeyjob.h ├── qgpgmesignarchivejob.h ├── job_p.h ├── qgpgmereceivekeysjob.cpp ├── qgpgmeimportfromkeyserverjob.h ├── qgpgmedecryptverifyarchivejob.h ├── qgpgmerefreshsmimekeysjob.h ├── qgpgmechangeexpiryjob.h ├── qgpgmequickjob.h ├── qgpgmedecryptjob.h ├── qgpgmeencryptarchivejob.h └── defaultkeygenerationjob.h ├── cmake └── modules │ ├── ECMVersionHeader.h.in │ ├── g10_generate_swdb.sh.in │ ├── g10_release.sh.in │ ├── g10_dist.sh.in │ ├── g10_sign-release.sh.in │ ├── ecm_uninstall.cmake.in │ ├── g10_generate_ChangeLog.cmake.in │ ├── ECMMarkNonGuiExecutable.cmake │ └── ECMMarkAsTest.cmake ├── doc ├── CMakeLists.txt └── DCO ├── NEWS ├── AUTHORS └── INSTALL.md /.gitattributes: -------------------------------------------------------------------------------- 1 | # we add a generated ChangeLog to the tarball 2 | /ChangeLog export-ignore 3 | -------------------------------------------------------------------------------- /tests/fixture/gpg.conf: -------------------------------------------------------------------------------- 1 | ignore-invalid-option pinentry-mode 2 | pinentry-mode loopback 3 | -------------------------------------------------------------------------------- /tests/fixture/gpg-agent.conf: -------------------------------------------------------------------------------- 1 | ignore-invalid-option allow-loopback-pinentry 2 | allow-loopback-pinentry 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # GnuPG exclusions 2 | /aclocal.m4 3 | /autom4te.cache 4 | /config.h.in 5 | /configure 6 | /VERSION 7 | Makefile.in 8 | 9 | # Hidden files 10 | *~ 11 | -------------------------------------------------------------------------------- /src/qgpgme_debug.h: -------------------------------------------------------------------------------- 1 | #ifndef QGPGME_QGPGME_DEBUG_H 2 | #define QGPGME_QGPGME_DEBUG_H 3 | 4 | #include 5 | 6 | Q_DECLARE_LOGGING_CATEGORY(QGPGME_LOG) 7 | Q_DECLARE_LOGGING_CATEGORY(QGPGME_CONFIG_LOADING_LOG) 8 | 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /tests/fixture.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | fixture/gpg-agent.conf 5 | fixture/gpg.conf 6 | fixture/pubdemo.asc 7 | fixture/secdemo.asc 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/qgpgme_debug.cpp: -------------------------------------------------------------------------------- 1 | #ifdef HAVE_CONFIG_H 2 | #include "config.h" 3 | #endif 4 | 5 | #include "qgpgme_debug.h" 6 | 7 | 8 | #if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) 9 | Q_LOGGING_CATEGORY(QGPGME_LOG, "gpg.qgpgme", QtWarningMsg) 10 | Q_LOGGING_CATEGORY(QGPGME_CONFIG_LOADING_LOG, "gpg.qgpgme.config_loading", QtInfoMsg) 11 | #else 12 | Q_LOGGING_CATEGORY(QGPGME_LOG, "gpg.qgpgme") 13 | Q_LOGGING_CATEGORY(QGPGME_CONFIG_LOADING_LOG, "gpg.qgpgme.config_loading") 14 | #endif 15 | -------------------------------------------------------------------------------- /cmake/modules/ECMVersionHeader.h.in: -------------------------------------------------------------------------------- 1 | // This file was generated by ecm_setup_version(): DO NOT EDIT! 2 | 3 | #ifndef @HEADER_PREFIX@_VERSION_H 4 | #define @HEADER_PREFIX@_VERSION_H 5 | 6 | #define @HEADER_PREFIX@_VERSION_STRING "@HEADER_VERSION@" 7 | #define @HEADER_PREFIX@_VERSION_MAJOR @HEADER_VERSION_MAJOR@ 8 | #define @HEADER_PREFIX@_VERSION_MINOR @HEADER_VERSION_MINOR@ 9 | #define @HEADER_PREFIX@_VERSION_PATCH @HEADER_VERSION_PATCH@ 10 | #define @HEADER_PREFIX@_VERSION ((@HEADER_VERSION_MAJOR@<<16)|(@HEADER_VERSION_MINOR@<<8)|(@HEADER_VERSION_PATCH@)) 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /doc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # CMakeLists.txt for QGpgME docs 2 | # Copyright 2025 g10 Code GmbH 3 | # Software engineering by Ingo Klöcker 4 | # 5 | # This file is part of QGpgME, the Qt API binding for GpgME. 6 | # 7 | # QGpgME is free software; you can redistribute it and/or modify it 8 | # under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation; either version 2 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # QGpgME is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | # General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program; if not, see . 19 | # SPDX-License-Identifier: GPL-2.0-or-later 20 | 21 | set(DOXYGEN_PROJECT_NAME QGpgME) 22 | set(DOXYGEN_PROJECT_NUMBER ${G10_FULL_VERSION}) 23 | set(DOXYGEN_PROJECT_BRIEF "Qt API for GpgME") 24 | set(DOXYGEN_RECURSIVE NO) 25 | set(DOXYGEN_FULL_PATH_NAMES NO) 26 | set(DOXYGEN_QUIET YES) 27 | set(DOXYGEN_WARN_IF_UNDOCUMENTED NO) 28 | 29 | doxygen_add_docs(docs 30 | ${CMAKE_SOURCE_DIR}/src 31 | ALL 32 | ) 33 | -------------------------------------------------------------------------------- /src/QGpgmeConfig.cmake.in: -------------------------------------------------------------------------------- 1 | # CMake Config file for QGpgME 2 | # Copyright 2025 g10 Code GmbH 3 | # Software engineering by Ingo Klöcker 4 | # 5 | # This file is part of QGpgME, the Qt API binding for GpgME. 6 | # 7 | # QGpgME is free software; you can redistribute it and/or modify it 8 | # under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation; either version 2 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # QGpgME is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program; if not, see . 19 | # SPDX-License-Identifier: GPL-2.0-or-later 20 | 21 | @PACKAGE_INIT@ 22 | 23 | include(CMakeFindDependencyMacro) 24 | list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") 25 | find_dependency(LibGpgError "@GPG_ERROR_REQUIRED_VERSION@") 26 | find_dependency(Gpgme "@GPGME_REQUIRED_VERSION@") 27 | find_dependency(Gpgmepp "@GPGMEPP_REQUIRED_VERSION@") 28 | 29 | include("${CMAKE_CURRENT_LIST_DIR}/@QGPGME_TARGETS_CMAKE_FILE@") 30 | -------------------------------------------------------------------------------- /doc/DCO: -------------------------------------------------------------------------------- 1 | QGPGME Developer's Certificate of Origin. Version 1.0 2 | ====================================================== 3 | 4 | By making a contribution to the QGPGME project, I certify that: 5 | 6 | (a) The contribution was created in whole or in part by me and I 7 | have the right to submit it under the free software license 8 | indicated in the file; or 9 | 10 | (b) The contribution is based upon previous work that, to the 11 | best of my knowledge, is covered under an appropriate free 12 | software license and I have the right under that license to 13 | submit that work with modifications, whether created in whole 14 | or in part by me, under the same free software license 15 | (unless I am permitted to submit under a different license), 16 | as indicated in the file; or 17 | 18 | (c) The contribution was provided directly to me by some other 19 | person who certified (a), (b) or (c) and I have not modified 20 | it. 21 | 22 | (d) I understand and agree that this project and the contribution 23 | are public and that a record of the contribution (including 24 | all personal information I submit with it, including my 25 | sign-off) is maintained indefinitely and may be redistributed 26 | consistent with this project or the free software license(s) 27 | involved. 28 | 29 | Signed-off-by: [Your name and mail address] 30 | -------------------------------------------------------------------------------- /cmake/modules/g10_generate_swdb.sh.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright 2025 g10 Code GmbH 4 | # Software engineering by Ingo Klöcker 5 | # 6 | # This file is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation; either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # This file is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program; if not, see . 18 | # 19 | # SPDX-License-Identifier: GPL-3.0-or-later 20 | 21 | set -e 22 | 23 | archive_filename="@release_name@.@archive_format@" 24 | 25 | if [ ! -e "${archive_filename}" ]; then 26 | echo "Error: '${archive_filename}' does not exist." >&2 27 | exit 1 28 | fi 29 | 30 | ( 31 | pref="#+macro: @swdb_prefix@_" 32 | reldate="$(date -u +%Y-%m-%d)" 33 | echo "${pref}ver @version@" 34 | echo "${pref}date ${reldate}" 35 | echo "${pref}size $(wc -c <"${archive_filename}" | awk '{print int($1/1024)}')k" 36 | echo "${pref}sha1 $(sha1sum <"${archive_filename}" | cut -d' ' -f1)" 37 | echo "${pref}sha2 $(sha256sum <"${archive_filename}" | cut -d' ' -f1)" 38 | ) | tee @release_name@.swdb 39 | -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- 1 | Noteworthy changes in version 2.0.1 (unreleased) 2 | ------------------------------------------------ 3 | 4 | 5 | Noteworthy changes in version 2.0.0 (2025-06-03) 6 | ------------------------------------------------ 7 | 8 | * First separate release of QGpgME. 9 | 10 | * cmake: The qgpgme folder containing the header files is no longer exported 11 | as include directory. All headers have to be included with the prefix 12 | qgpgme/ now. The camel-case headers are still included with the prefix 13 | QGpgME/. 14 | 15 | * Added function returning the ordered list of attributes of a DN. 16 | 17 | * Interface changes relative to the 1.24 branch of gpgme: 18 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 19 | DN::prettyAttributes NEW. 20 | QuickJob::startCreate CHANGED: New overload; deprecate old 21 | and make it non-virtual. 22 | QuickJob::startAddSubkey CHANGED: New overload; deprecate old 23 | and make it non-virtual. 24 | 25 | 26 | Noteworthy changes in earlier versions can be found in the NEWS file of 27 | gpgme. 28 | 29 | 30 | Copyright 2024 g10 Code GmbH 31 | 32 | This file is free software; as a special exception the author gives 33 | unlimited permission to copy and/or distribute it, with or without 34 | modifications, as long as this notice is preserved. 35 | 36 | This file is distributed in the hope that it will be useful, but 37 | WITHOUT ANY WARRANTY, to the extent permitted by law; without even the 38 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 39 | -------------------------------------------------------------------------------- /cmake/modules/g10_release.sh.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright 2025 g10 Code GmbH 4 | # Software engineering by Ingo Klöcker 5 | # 6 | # This file is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation; either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # This file is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program; if not, see . 18 | # 19 | # SPDX-License-Identifier: GPL-3.0-or-later 20 | 21 | ( 22 | set -e 23 | 24 | if [ "@CMAKE_BINARY_DIR@" = "@CMAKE_SOURCE_DIR@" ]; then 25 | echo "error: build directory must not be the source directory" >&2 26 | exit 2 27 | fi 28 | 29 | echo "/* Build started at $(date -uIseconds) */" 30 | 31 | cd @CMAKE_BINARY_DIR@ 32 | if [ -d "dist/@release_name@" ]; then 33 | find "dist/@release_name@" -type d ! -perm -700 -exec chmod u+rwx {} ';' 34 | fi 35 | rm -rf dist 36 | mkdir dist 37 | cd dist 38 | @CMAKE_COMMAND@ @CMAKE_SOURCE_DIR@/CMakeLists.txt 39 | 40 | @CMAKE_COMMAND@ --build . --verbose -t distcheck 41 | @CMAKE_COMMAND@ --build . -t gen-swdb 42 | 43 | echo "/* Build finished at $(date -uIseconds) */" 44 | echo "/*" 45 | echo " * Please run the final step interactively:" 46 | echo " * make sign-release" 47 | echo " */" 48 | ) 2>&1 | tee "@release_name@.buildlog" 49 | -------------------------------------------------------------------------------- /src/exportjob.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | exportjob.cpp 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2025 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #include "exportjob.h" 35 | 36 | using namespace QGpgME; 37 | 38 | ExportJob::ExportJob(QObject *parent) 39 | : Job{parent} 40 | { 41 | } 42 | 43 | ExportJob::~ExportJob() = default; 44 | 45 | #include "moc_exportjob.cpp" 46 | -------------------------------------------------------------------------------- /src/decryptjob.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | decryptjob.cpp 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2025 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #include "decryptjob.h" 35 | 36 | using namespace QGpgME; 37 | 38 | DecryptJob::DecryptJob(QObject *parent) 39 | : Job{parent} 40 | { 41 | } 42 | 43 | DecryptJob::~DecryptJob() = default; 44 | 45 | #include "moc_decryptjob.cpp" 46 | -------------------------------------------------------------------------------- /src/gpgcardjob.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | gpgcardjob.cpp 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2025 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #include "gpgcardjob.h" 35 | 36 | using namespace QGpgME; 37 | 38 | GpgCardJob::GpgCardJob(QObject *parent) 39 | : Job{parent} 40 | { 41 | } 42 | 43 | GpgCardJob::~GpgCardJob() = default; 44 | 45 | #include "moc_gpgcardjob.cpp" 46 | -------------------------------------------------------------------------------- /src/keylistjob.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | keylistjob.cpp 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2025 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #include "keylistjob.h" 35 | 36 | using namespace QGpgME; 37 | 38 | KeyListJob::KeyListJob(QObject *parent) 39 | : Job{parent} 40 | { 41 | } 42 | 43 | KeyListJob::~KeyListJob() = default; 44 | 45 | #include "moc_keylistjob.cpp" 46 | -------------------------------------------------------------------------------- /src/signkeyjob.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | signkeyjob.cpp 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2025 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #include "signkeyjob.h" 35 | 36 | using namespace QGpgME; 37 | 38 | SignKeyJob::SignKeyJob(QObject *parent) 39 | : Job{parent} 40 | { 41 | } 42 | 43 | SignKeyJob::~SignKeyJob() = default; 44 | 45 | #include "moc_signkeyjob.cpp" 46 | -------------------------------------------------------------------------------- /src/specialjob.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | specialjob.cpp 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2025 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #include "specialjob.h" 35 | 36 | using namespace QGpgME; 37 | 38 | SpecialJob::SpecialJob(QObject *parent) 39 | : Job{parent} 40 | { 41 | } 42 | 43 | SpecialJob::~SpecialJob() = default; 44 | 45 | #include "moc_specialjob.cpp" 46 | -------------------------------------------------------------------------------- /src/downloadjob.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | downloadjob.cpp 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2025 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #include "downloadjob.h" 35 | 36 | using namespace QGpgME; 37 | 38 | DownloadJob::DownloadJob(QObject *parent) 39 | : Job{parent} 40 | { 41 | } 42 | 43 | DownloadJob::~DownloadJob() = default; 44 | 45 | #include "moc_downloadjob.cpp" 46 | -------------------------------------------------------------------------------- /src/adduseridjob.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | adduseridjob.cpp 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2025 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #include "adduseridjob.h" 35 | 36 | using namespace QGpgME; 37 | 38 | AddUserIDJob::AddUserIDJob(QObject *parent) 39 | : Job{parent} 40 | { 41 | } 42 | 43 | AddUserIDJob::~AddUserIDJob() = default; 44 | 45 | #include "moc_adduseridjob.cpp" 46 | -------------------------------------------------------------------------------- /src/revokekeyjob.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | revokekeyjob.cpp 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2025 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #include "revokekeyjob.h" 35 | 36 | using namespace QGpgME; 37 | 38 | RevokeKeyJob::RevokeKeyJob(QObject *parent) 39 | : Job{parent} 40 | { 41 | } 42 | 43 | RevokeKeyJob::~RevokeKeyJob() = default; 44 | 45 | #include "moc_revokekeyjob.cpp" 46 | -------------------------------------------------------------------------------- /src/wkdlookupjob.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | wkdlookupjob.cpp 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2025 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #include "wkdlookupjob.h" 35 | 36 | using namespace QGpgME; 37 | 38 | WKDLookupJob::WKDLookupJob(QObject *parent) 39 | : Job{parent} 40 | { 41 | } 42 | 43 | WKDLookupJob::~WKDLookupJob() = default; 44 | 45 | #include "moc_wkdlookupjob.cpp" 46 | -------------------------------------------------------------------------------- /src/tofupolicyjob.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | tofupolicyjob.cpp 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2025 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #include "tofupolicyjob.h" 35 | 36 | using namespace QGpgME; 37 | 38 | TofuPolicyJob::TofuPolicyJob(QObject *parent) 39 | : Job{parent} 40 | { 41 | } 42 | 43 | TofuPolicyJob::~TofuPolicyJob() = default; 44 | 45 | #include "moc_tofupolicyjob.cpp" 46 | -------------------------------------------------------------------------------- /src/wkspublishjob.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | wkspublishjob.cpp 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2025 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #include "wkspublishjob.h" 35 | 36 | using namespace QGpgME; 37 | 38 | WKSPublishJob::WKSPublishJob(QObject *parent) 39 | : Job{parent} 40 | { 41 | } 42 | 43 | WKSPublishJob::~WKSPublishJob() = default; 44 | 45 | #include "moc_wkspublishjob.cpp" 46 | -------------------------------------------------------------------------------- /src/refreshkeysjob.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | refreshkeysjob.cpp 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2025 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #include "refreshkeysjob.h" 35 | 36 | using namespace QGpgME; 37 | 38 | RefreshKeysJob::RefreshKeysJob(QObject *parent) 39 | : Job{parent} 40 | { 41 | } 42 | 43 | RefreshKeysJob::~RefreshKeysJob() = default; 44 | 45 | #include "moc_refreshkeysjob.cpp" 46 | -------------------------------------------------------------------------------- /src/changepasswdjob.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | changepasswdjob.cpp 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2025 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #include "changepasswdjob.h" 35 | 36 | using namespace QGpgME; 37 | 38 | ChangePasswdJob::ChangePasswdJob(QObject *parent) 39 | : Job{parent} 40 | { 41 | } 42 | 43 | ChangePasswdJob::~ChangePasswdJob() = default; 44 | 45 | #include "moc_changepasswdjob.cpp" 46 | -------------------------------------------------------------------------------- /src/receivekeysjob.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | receivekeysjob.cpp 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2025 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #include "receivekeysjob.h" 35 | 36 | using namespace QGpgME; 37 | 38 | ReceiveKeysJob::ReceiveKeysJob(QObject *parent) 39 | : AbstractImportJob{parent} 40 | { 41 | } 42 | 43 | ReceiveKeysJob::~ReceiveKeysJob() = default; 44 | 45 | #include "moc_receivekeysjob.cpp" 46 | -------------------------------------------------------------------------------- /src/keyformailboxjob.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | keyformailboxjob.cpp 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2025 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #include "keyformailboxjob.h" 35 | 36 | using namespace QGpgME; 37 | 38 | KeyForMailboxJob::KeyForMailboxJob(QObject *parent) 39 | : Job{parent} 40 | { 41 | } 42 | 43 | KeyForMailboxJob::~KeyForMailboxJob() = default; 44 | 45 | #include "moc_keyformailboxjob.cpp" 46 | -------------------------------------------------------------------------------- /src/keygenerationjob.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | keygenerationjob.cpp 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2025 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #include "keygenerationjob.h" 35 | 36 | using namespace QGpgME; 37 | 38 | KeyGenerationJob::KeyGenerationJob(QObject *parent) 39 | : Job{parent} 40 | { 41 | } 42 | 43 | KeyGenerationJob::~KeyGenerationJob() = default; 44 | 45 | #include "moc_keygenerationjob.cpp" 46 | -------------------------------------------------------------------------------- /src/abstractimportjob_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | abstractimportjob_p.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2025 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #ifndef __QGPGME_ABSTRACTIMPORTJOB_P_H__ 35 | #define __QGPGME_ABSTRACTIMPORTJOB_P_H__ 36 | 37 | #include "job_p.h" 38 | 39 | namespace QGpgME 40 | { 41 | 42 | class AbstractImportJobPrivate : public JobPrivate 43 | { 44 | }; 45 | 46 | } 47 | 48 | #endif // __QGPGME_ABSTRACTIMPORTJOB_P_H__ 49 | -------------------------------------------------------------------------------- /src/changeownertrustjob.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | changeownertrustjob.cpp 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2025 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #include "changeownertrustjob.h" 35 | 36 | using namespace QGpgME; 37 | 38 | ChangeOwnerTrustJob::ChangeOwnerTrustJob(QObject *parent) 39 | : Job{parent} 40 | { 41 | } 42 | 43 | ChangeOwnerTrustJob::~ChangeOwnerTrustJob() = default; 44 | 45 | #include "moc_changeownertrustjob.cpp" 46 | -------------------------------------------------------------------------------- /src/setprimaryuseridjob.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | setprimaryuseridjob.cpp 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2025 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #include "setprimaryuseridjob.h" 35 | 36 | using namespace QGpgME; 37 | 38 | SetPrimaryUserIDJob::SetPrimaryUserIDJob(QObject *parent) 39 | : Job{parent} 40 | { 41 | } 42 | 43 | SetPrimaryUserIDJob::~SetPrimaryUserIDJob() = default; 44 | 45 | #include "moc_setprimaryuseridjob.cpp" 46 | -------------------------------------------------------------------------------- /src/addexistingsubkeyjob.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | addexistingsubkeyjob.cpp 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2025 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #include "addexistingsubkeyjob.h" 35 | 36 | using namespace QGpgME; 37 | 38 | AddExistingSubkeyJob::AddExistingSubkeyJob(QObject *parent) 39 | : Job{parent} 40 | { 41 | } 42 | 43 | AddExistingSubkeyJob::~AddExistingSubkeyJob() = default; 44 | 45 | #include "moc_addexistingsubkeyjob.cpp" 46 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Package: qgpgme 2 | Homepage: https://gnupg.org/software/gpgme/ 3 | Download: https://gnupg.org/ftp/gcrypt/gpgme/ 4 | Repository: git://git.gnupg.org/gpgme.git 5 | Maintainer: Werner Koch 6 | Bug reports: https://bugs.gnupg.org 7 | Security related bug reports: security@gnupg.org 8 | License (software): GPL-2.0-or-later 9 | License (tests): GPL-2.0-only, GPL-2.0-or-later 10 | 11 | 12 | QGpgME is free software. See the file COPYING for copying conditions. 13 | License copyright years may be listed using range notation, e.g., 2000-2013, 14 | indicating that every year in the range, inclusive, is a copyrightable 15 | year that would otherwise be listed individually. 16 | 17 | 18 | List of Copyright holders 19 | ========================= 20 | 21 | Copyright (C) 1992-2022 Free Software Foundation, Inc. 22 | Copyright (C) 2000 Werner Koch 23 | Copyright (C) 2001-2024 g10 Code GmbH 24 | Copyright (C) 2004, 2005, 2007, 2008, 2009, 2010, 2016 25 | Klarälvdalens Datakonsult AB 26 | Copyright (C) 2004-2016 several members of the KDE community 27 | (see git log of gpgmepp, kdepimlibs and kdepim repositories 28 | in KDE's git) 29 | Copyright (C) 2016, 2017 30 | Bundesamt für Sicherheit in der Informationstechnik 31 | Copyright (C) 2016, 2017 Intevation GmbH 32 | 33 | 34 | Authors with a DCO 35 | ================== 36 | 37 | Daniel Kahn Gillmor 38 | 2014-09-24:878ul9w4j8.fsf@alice.fifthhorseman.net: 39 | 40 | 41 | Copyright 2001, 2002, 2012, 2013 g10 Code GmbH 42 | 43 | This file is free software; as a special exception the author gives 44 | unlimited permission to copy and/or distribute it, with or without 45 | modifications, as long as this notice is preserved. 46 | 47 | This file is distributed in the hope that it will be useful, but 48 | WITHOUT ANY WARRANTY, to the extent permitted by law; without even the 49 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 50 | -------------------------------------------------------------------------------- /src/importfromkeyserverjob.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | importfromkeyserverjob.cpp 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2025 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #include "importfromkeyserverjob.h" 35 | 36 | using namespace QGpgME; 37 | 38 | ImportFromKeyserverJob::ImportFromKeyserverJob(QObject *parent) 39 | : AbstractImportJob{parent} 40 | { 41 | } 42 | 43 | ImportFromKeyserverJob::~ImportFromKeyserverJob() = default; 44 | 45 | #include "moc_importfromkeyserverjob.cpp" 46 | -------------------------------------------------------------------------------- /cmake/modules/g10_dist.sh.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright 2025 g10 Code GmbH 4 | # Software engineering by Ingo Klöcker 5 | # 6 | # This file is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation; either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # This file is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program; if not, see . 18 | # 19 | # SPDX-License-Identifier: GPL-3.0-or-later 20 | 21 | set -e 22 | 23 | tarball_name="@g10_dist_archive_name@" 24 | tarball_format="@g10_dist_archive_format@" 25 | tarball_filename="${tarball_name}.${tarball_format}" 26 | 27 | if ! git --version >/dev/null 2>&1; then 28 | echo "Error: Could not find git." >&2 29 | exit 1 30 | fi 31 | if [ ! -e "@CMAKE_SOURCE_DIR@/.git" ]; then 32 | echo "Error: Source folder @CMAKE_SOURCE_DIR@ is not a git repository." >&2 33 | exit 1 34 | fi 35 | 36 | cd "@CMAKE_SOURCE_DIR@" 37 | 38 | # check if the requested archive format is supported by git 39 | if ! ( git archive -l | grep -q "^${tarball_format}$" ); then 40 | echo "Warning: git archive doesn't seem to support the format ${tarball_format}." 41 | echo " You can tell git how to create an archive of this format with something like this:" 42 | echo " git config --global tar.${tarball_format}.command 'fooz -c'" 43 | fi 44 | 45 | git archive --format "${tarball_format}" \ 46 | --prefix "${tarball_name}/" \ 47 | --output "@CMAKE_BINARY_DIR@/${tarball_filename}" \ 48 | @g10_dist_git_archive_extra_arguments@ \ 49 | HEAD 50 | -------------------------------------------------------------------------------- /src/deletejob_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | deletejob_p.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2025 g10 Code GmbH 6 | 7 | QGpgME is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License as 9 | published by the Free Software Foundation; either version 2 of the 10 | License, or (at your option) any later version. 11 | 12 | QGpgME is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | 21 | In addition, as a special exception, the copyright holders give 22 | permission to link the code of this program with any edition of 23 | the Qt library by Trolltech AS, Norway (or with modified versions 24 | of Qt that use the same license as Qt), and distribute linked 25 | combinations including the two. You must obey the GNU General 26 | Public License in all respects for all of the code used other than 27 | Qt. If you modify this file, you may extend this exception to 28 | your version of the file, but you are not obligated to do so. If 29 | you do not wish to do so, delete this exception statement from 30 | your version. 31 | */ 32 | 33 | #ifndef __QGPGME_DELETEJOB_P_H__ 34 | #define __QGPGME_DELETEJOB_P_H__ 35 | 36 | #include "job_p.h" 37 | 38 | #include 39 | #include "deletejob.h" 40 | 41 | namespace QGpgME 42 | { 43 | 44 | class DeleteJobPrivate : public JobPrivate 45 | { 46 | public: 47 | virtual GpgME::Error start(const GpgME::Key &key, GpgME::DeletionFlags flags) = 0; 48 | }; 49 | 50 | } 51 | 52 | #endif // __QGPGME_DELETEJOB_P_H__ 53 | -------------------------------------------------------------------------------- /src/listallkeysjob_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | listallkeysjob_p.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2022,2023 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #ifndef __QGPGME_LISTALLKEYSJOB_P_H__ 35 | #define __QGPGME_LISTALLKEYSJOB_P_H__ 36 | 37 | #include "job_p.h" 38 | 39 | #include "listallkeysjob.h" 40 | 41 | namespace QGpgME 42 | { 43 | 44 | class ListAllKeysJobPrivate : public JobPrivate 45 | { 46 | public: 47 | ListAllKeysJob::Options m_options = ListAllKeysJob::Default; 48 | }; 49 | 50 | } 51 | 52 | #endif // __QGPGME_LISTALLKEYSJOB_P_H__ 53 | -------------------------------------------------------------------------------- /src/verifyopaquejob_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | verifyopaquejob_p.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2023 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #ifndef __QGPGME_VERIFYOPAQUEJOB_P_H__ 35 | #define __QGPGME_VERIFYOPAQUEJOB_P_H__ 36 | 37 | #include "job_p.h" 38 | 39 | namespace QGpgME 40 | { 41 | 42 | class VerifyOpaqueJobPrivate : public JobPrivate 43 | { 44 | public: 45 | QString m_inputFilePath; 46 | QString m_outputFilePath; 47 | bool m_processAllSignatures = false; 48 | }; 49 | 50 | } 51 | 52 | #endif // __QGPGME_VERIFYOPAQUEJOB_P_H__ 53 | -------------------------------------------------------------------------------- /src/changeexpiryjob_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | changeexpiryjob_p.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2021,2023 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #ifndef __QGPGME_CHANGEEXPIRYJOB_P_H__ 35 | #define __QGPGME_CHANGEEXPIRYJOB_P_H__ 36 | 37 | #include "job_p.h" 38 | 39 | #include "changeexpiryjob.h" 40 | 41 | namespace QGpgME 42 | { 43 | 44 | class ChangeExpiryJobPrivate : public JobPrivate 45 | { 46 | public: 47 | ChangeExpiryJob::Options m_options = ChangeExpiryJob::Default; 48 | }; 49 | 50 | } 51 | 52 | #endif // __QGPGME_CHANGEEXPIRYJOB_P_H__ 53 | -------------------------------------------------------------------------------- /src/decryptverifyjob_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | decryptverifyjob_p.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2023 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #ifndef __QGPGME_DECRYPTVERIFYJOB_P_H__ 35 | #define __QGPGME_DECRYPTVERIFYJOB_P_H__ 36 | 37 | #include "job_p.h" 38 | 39 | namespace QGpgME 40 | { 41 | 42 | class DecryptVerifyJobPrivate : public JobPrivate 43 | { 44 | public: 45 | QString m_inputFilePath; 46 | QString m_outputFilePath; 47 | bool m_processAllSignatures = false; 48 | }; 49 | 50 | } 51 | 52 | #endif // __QGPGME_DECRYPTVERIFYJOB_P_H__ 53 | -------------------------------------------------------------------------------- /src/verifydetachedjob_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | verifydetachedjob_p.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2024 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #ifndef __QGPGME_VERIFYDETACHEDJOB_P_H__ 35 | #define __QGPGME_VERIFYDETACHEDJOB_P_H__ 36 | 37 | #include "job_p.h" 38 | 39 | namespace QGpgME 40 | { 41 | 42 | class VerifyDetachedJobPrivate : public JobPrivate 43 | { 44 | public: 45 | QString m_signatureFilePath; 46 | QString m_signedFilePath; 47 | bool m_processAllSignatures = false; 48 | }; 49 | 50 | } 51 | 52 | #endif // __QGPGME_VERIFYDETACHEDJOB_P_H__ 53 | -------------------------------------------------------------------------------- /src/wkdrefreshjob_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | wkdrefreshjob_p.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2023 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #ifndef __QGPGME_WKDREFRESHJOB_P_H__ 35 | #define __QGPGME_WKDREFRESHJOB_P_H__ 36 | 37 | #include "abstractimportjob_p.h" 38 | 39 | #include 40 | 41 | namespace QGpgME 42 | { 43 | 44 | class WKDRefreshJobPrivate : public AbstractImportJobPrivate 45 | { 46 | public: 47 | std::vector m_keys; 48 | std::vector m_userIds; 49 | }; 50 | 51 | } 52 | 53 | #endif // __QGPGME_WKDREFRESHJOB_P_H__ 54 | -------------------------------------------------------------------------------- /src/signarchivejob_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | signarchivejob_p.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2023 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #ifndef __QGPGME_SIGNARCHIVEJOB_P_H__ 35 | #define __QGPGME_SIGNARCHIVEJOB_P_H__ 36 | 37 | #include "job_p.h" 38 | 39 | namespace QGpgME 40 | { 41 | 42 | class SignArchiveJobPrivate : public JobPrivate 43 | { 44 | public: 45 | std::vector m_signers; 46 | std::vector m_inputPaths; 47 | QString m_outputFilePath; 48 | QString m_baseDirectory; 49 | }; 50 | 51 | } 52 | 53 | #endif // __QGPGME_SIGNARCHIVEJOB_P_H__ 54 | -------------------------------------------------------------------------------- /src/deletejob.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | deletejob.cpp 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2025 g10 Code GmbH 6 | 7 | QGpgME is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License as 9 | published by the Free Software Foundation; either version 2 of the 10 | License, or (at your option) any later version. 11 | 12 | QGpgME is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | 21 | In addition, as a special exception, the copyright holders give 22 | permission to link the code of this program with any edition of 23 | the Qt library by Trolltech AS, Norway (or with modified versions 24 | of Qt that use the same license as Qt), and distribute linked 25 | combinations including the two. You must obey the GNU General 26 | Public License in all respects for all of the code used other than 27 | Qt. If you modify this file, you may extend this exception to 28 | your version of the file, but you are not obligated to do so. If 29 | you do not wish to do so, delete this exception statement from 30 | your version. 31 | */ 32 | 33 | #include "deletejob.h" 34 | #include "deletejob_p.h" 35 | 36 | #include 37 | 38 | using namespace QGpgME; 39 | using namespace GpgME; 40 | 41 | DeleteJob::DeleteJob(std::unique_ptr dd, QObject *parent) 42 | : Job{std::move(dd), parent} 43 | { 44 | } 45 | 46 | GpgME::Error DeleteJob::start(const Key &key, GpgME::DeletionFlags flags) 47 | { 48 | Q_D(DeleteJob); 49 | return d->start(key, flags); 50 | } 51 | 52 | DeleteJob::~DeleteJob() = default; 53 | 54 | #include "moc_deletejob.cpp" 55 | -------------------------------------------------------------------------------- /src/decryptverifyarchivejob_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | decryptverifyarchivejob_p.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2023 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #ifndef __QGPGME_DECRYPTVERIFYARCHIVEJOB_P_H__ 35 | #define __QGPGME_DECRYPTVERIFYARCHIVEJOB_P_H__ 36 | 37 | #include "job_p.h" 38 | 39 | namespace QGpgME 40 | { 41 | 42 | class DecryptVerifyArchiveJobPrivate : public JobPrivate 43 | { 44 | public: 45 | QString m_inputFilePath; 46 | QString m_outputDirectory; 47 | bool m_processAllSignatures = false; 48 | }; 49 | 50 | } 51 | 52 | #endif // __QGPGME_DECRYPTVERIFYARCHIVEJOB_P_H__ 53 | -------------------------------------------------------------------------------- /src/abstractimportjob.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | abstractimportjob.cpp 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2025 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #include "abstractimportjob.h" 35 | #include "abstractimportjob_p.h" 36 | 37 | using namespace QGpgME; 38 | 39 | AbstractImportJob::AbstractImportJob(std::unique_ptr dd, QObject *parent) 40 | : Job{std::move(dd), parent} 41 | { 42 | } 43 | 44 | AbstractImportJob::AbstractImportJob(QObject *parent) 45 | : Job{parent} 46 | { 47 | } 48 | 49 | AbstractImportJob::~AbstractImportJob() = default; 50 | 51 | #include "moc_abstractimportjob.cpp" 52 | -------------------------------------------------------------------------------- /src/importjob_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | importjob_p.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2021,2023 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #ifndef __QGPGME_IMPORTJOB_P_H__ 35 | #define __QGPGME_IMPORTJOB_P_H__ 36 | 37 | #include "abstractimportjob_p.h" 38 | 39 | #include 40 | 41 | namespace QGpgME 42 | { 43 | 44 | class ImportJobPrivate : public AbstractImportJobPrivate 45 | { 46 | public: 47 | QString m_importFilter; 48 | QStringList m_importOptions; 49 | GpgME::Key::Origin m_keyOrigin = GpgME::Key::OriginUnknown; 50 | QString m_keyOriginUrl; 51 | }; 52 | 53 | } 54 | 55 | #endif // __QGPGME_IMPORTJOB_P_H__ 56 | -------------------------------------------------------------------------------- /src/signjob_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | signjob_p.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2023 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #ifndef __QGPGME_SIGNJOB_P_H__ 35 | #define __QGPGME_SIGNJOB_P_H__ 36 | 37 | #include "job_p.h" 38 | 39 | #include 40 | 41 | namespace QGpgME 42 | { 43 | 44 | class SignJobPrivate : public JobPrivate 45 | { 46 | public: 47 | // used by startIt() 48 | std::vector m_signers; 49 | QString m_inputFilePath; 50 | QString m_outputFilePath; 51 | GpgME::SignatureMode m_signingFlags = GpgME::SignFile; 52 | bool m_appendSignature = false; 53 | }; 54 | 55 | } 56 | 57 | #endif // __QGPGME_SIGNJOB_P_H__ 58 | -------------------------------------------------------------------------------- /cmake/modules/g10_sign-release.sh.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright 2025 g10 Code GmbH 4 | # Software engineering by Ingo Klöcker 5 | # 6 | # This file is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation; either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # This file is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program; if not, see . 18 | # 19 | # SPDX-License-Identifier: GPL-3.0-or-later 20 | 21 | set -e 22 | 23 | test $(pwd | sed 's,.*/,,') = dist || cd dist 24 | x=$(grep '^RELEASE_ARCHIVE=' $HOME/.gnupg-autogen.rc|cut -d= -f2) 25 | if [ -z "$x" ]; then 26 | echo "error: RELEASE_ARCHIVE missing in ~/.gnupg-autogen.rc">&2 27 | exit 2 28 | fi 29 | myarchive="$x/@release_archive_suffix@" 30 | x=$(grep '^RELEASE_SIGNKEY=' $HOME/.gnupg-autogen.rc|cut -d= -f2) 31 | if [ -z "$x" ]; then 32 | echo "error: RELEASE_SIGNKEY missing in ~/.gnupg-autogen.rc">&2 33 | exit 2 34 | fi 35 | mysignkey="$x" 36 | files1= 37 | suffix= 38 | for suf in xz bz2 gz; do 39 | if [ -f "@release_name@.tar.$suf" ]; then 40 | files1="@release_name@.tar.$suf" 41 | files2="@release_name@.tar.$suf.sig" 42 | suffix=$suf 43 | break 44 | fi 45 | done 46 | files2="$files2 47 | @release_name@.swdb 48 | @release_name@.buildlog" 49 | echo "/* Signing the source tarball ..." 50 | gpg -sbu $mysignkey @release_name@.tar.$suffix 51 | cat @release_name@.swdb >swdb.snippet 52 | echo >>swdb.snippet 53 | sha1sum ${files1} >>swdb.snippet 54 | cat "../@release_name@.buildlog" swdb.snippet \ 55 | | gzip >@release_name@.buildlog 56 | echo "Copying to local archive ..." 57 | scp -p ${files1} ${files2} $myarchive/ || true 58 | echo '/*' 59 | echo ' * All done; for checksums see dist/swdb.snippet' 60 | echo ' */' 61 | -------------------------------------------------------------------------------- /src/encryptarchivejob_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | encryptarchivejob_p.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2023 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #ifndef __QGPGME_ENCRYPTARCHIVEJOB_P_H__ 35 | #define __QGPGME_ENCRYPTARCHIVEJOB_P_H__ 36 | 37 | #include "job_p.h" 38 | 39 | namespace QGpgME 40 | { 41 | 42 | class EncryptArchiveJobPrivate : public JobPrivate 43 | { 44 | public: 45 | std::vector m_recipients; 46 | std::vector m_inputPaths; 47 | QString m_outputFilePath; 48 | QString m_baseDirectory; 49 | GpgME::Context::EncryptionFlags m_encryptionFlags = GpgME::Context::EncryptArchive; 50 | }; 51 | 52 | } 53 | 54 | #endif // __QGPGME_ENCRYPTARCHIVEJOB_P_H__ 55 | -------------------------------------------------------------------------------- /src/qt6compat_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | qt6compat_p.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2025 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #pragma once 35 | 36 | #include 37 | 38 | #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) 39 | 40 | #include 41 | 42 | namespace Qt 43 | { 44 | inline namespace Literals 45 | { 46 | inline namespace StringLiterals 47 | { 48 | inline QString operator""_s(const char16_t *str, size_t size) noexcept 49 | { 50 | return QString::fromUtf16(const_cast(str), int(size)); 51 | } 52 | constexpr inline QLatin1String operator""_L1(const char *str, size_t size) noexcept 53 | { 54 | return QLatin1String{str, int(size)}; 55 | } 56 | } // StringLiterals 57 | } // Literals 58 | } // Qt 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /src/debug.h: -------------------------------------------------------------------------------- 1 | /* 2 | debug.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2020 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #ifndef QGPGME_DEBUG_H 35 | #define QGPGME_DEBUG_H 36 | 37 | #include "qgpgme_export.h" 38 | 39 | #include 40 | 41 | namespace GpgME 42 | { 43 | class Error; 44 | } 45 | 46 | class QDebug; 47 | 48 | QGPGME_EXPORT QDebug operator<<(QDebug debug, const GpgME::Error &err); 49 | 50 | namespace QGpgME 51 | { 52 | /** 53 | * Helper to log GpgME objects which provide the output stream operator. 54 | */ 55 | template 56 | std::string toLogString(const GpgMEClass &object) 57 | { 58 | std::stringstream stream; 59 | stream << object; 60 | return stream.str(); 61 | } 62 | } 63 | 64 | #endif // QGPGME_DEBUG_H 65 | -------------------------------------------------------------------------------- /src/signencryptarchivejob_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | signencryptarchivejob_p.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2023 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #ifndef __QGPGME_SIGNENCRYPTARCHIVEJOB_P_H__ 35 | #define __QGPGME_SIGNENCRYPTARCHIVEJOB_P_H__ 36 | 37 | #include "job_p.h" 38 | 39 | namespace QGpgME 40 | { 41 | 42 | class SignEncryptArchiveJobPrivate : public JobPrivate 43 | { 44 | public: 45 | std::vector m_signers; 46 | std::vector m_recipients; 47 | std::vector m_inputPaths; 48 | QString m_outputFilePath; 49 | QString m_baseDirectory; 50 | GpgME::Context::EncryptionFlags m_encryptionFlags = GpgME::Context::EncryptArchive; 51 | }; 52 | 53 | } 54 | 55 | #endif // __QGPGME_SIGNENCRYPTARCHIVEJOB_P_H__ 56 | -------------------------------------------------------------------------------- /src/signencryptjob_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | signencryptjob_p.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2022,2023 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #ifndef __QGPGME_SIGNENCRYPTJOB_P_H__ 35 | #define __QGPGME_SIGNENCRYPTJOB_P_H__ 36 | 37 | #include "job_p.h" 38 | 39 | #include 40 | 41 | namespace QGpgME 42 | { 43 | 44 | class SignEncryptJobPrivate : public JobPrivate 45 | { 46 | public: 47 | // used by start() functions 48 | QString m_fileName; 49 | 50 | // used by startIt() 51 | std::vector m_signers; 52 | std::vector m_recipients; 53 | QString m_inputFilePath; 54 | QString m_outputFilePath; 55 | GpgME::Context::EncryptionFlags m_encryptionFlags = GpgME::Context::EncryptFile; 56 | }; 57 | 58 | } 59 | 60 | #endif // __QGPGME_SIGNENCRYPTJOB_P_H__ 61 | -------------------------------------------------------------------------------- /src/encryptjob_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | encryptjob_p.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2022,2023 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #ifndef __QGPGME_ENCRYPTJOB_P_H__ 35 | #define __QGPGME_ENCRYPTJOB_P_H__ 36 | 37 | #include "job_p.h" 38 | 39 | #include 40 | #include 41 | 42 | namespace QGpgME 43 | { 44 | 45 | class EncryptJobPrivate : public JobPrivate 46 | { 47 | public: 48 | // used by start() functions 49 | QString m_fileName; 50 | GpgME::Data::Encoding m_inputEncoding; 51 | 52 | // used by startIt() 53 | std::vector m_recipients; 54 | QString m_inputFilePath; 55 | QString m_outputFilePath; 56 | GpgME::Context::EncryptionFlags m_encryptionFlags = GpgME::Context::EncryptFile; 57 | }; 58 | 59 | } 60 | 61 | #endif // __QGPGME_ENCRYPTJOB_P_H__ 62 | -------------------------------------------------------------------------------- /src/listallkeysjob.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | listallkeysjob.cpp 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2022 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #ifdef HAVE_CONFIG_H 35 | #include "config.h" 36 | #endif 37 | 38 | #include "listallkeysjob.h" 39 | #include "listallkeysjob_p.h" 40 | 41 | using namespace QGpgME; 42 | 43 | ListAllKeysJob::ListAllKeysJob(std::unique_ptr dd, QObject *parent) 44 | : Job{std::move(dd), parent} 45 | { 46 | } 47 | 48 | ListAllKeysJob::~ListAllKeysJob() = default; 49 | 50 | void ListAllKeysJob::setOptions(ListAllKeysJob::Options options) 51 | { 52 | Q_D(ListAllKeysJob); 53 | d->m_options = options; 54 | } 55 | 56 | ListAllKeysJob::Options ListAllKeysJob::options() const 57 | { 58 | Q_D(const ListAllKeysJob); 59 | return d->m_options; 60 | } 61 | 62 | #include "moc_listallkeysjob.cpp" 63 | -------------------------------------------------------------------------------- /tests/run-keyformailboxjob.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | run-keyformailbox.cpp 3 | 4 | This file is part of QGpgME's test suite. 5 | Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik 6 | Software engineering by Intevation GmbH 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License, 10 | version 2, as published by the Free Software Foundation. 11 | 12 | QGpgME is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | 21 | In addition, as a special exception, the copyright holders give 22 | permission to link the code of this program with any edition of 23 | the Qt library by Trolltech AS, Norway (or with modified versions 24 | of Qt that use the same license as Qt), and distribute linked 25 | combinations including the two. You must obey the GNU General 26 | Public License in all respects for all of the code used other than 27 | Qt. If you modify this file, you may extend this exception to 28 | your version of the file, but you are not obligated to do so. If 29 | you do not wish to do so, delete this exception statement from 30 | your version. 31 | */ 32 | 33 | #ifdef HAVE_CONFIG_H 34 | #include "config.h" 35 | #endif 36 | 37 | #include "keyformailboxjob.h" 38 | #include "keylistjob.h" 39 | #include "protocol.h" 40 | 41 | #include 42 | #include 43 | 44 | #include 45 | 46 | 47 | int main(int argc, char **argv) 48 | { 49 | QString mailbox; 50 | if (argc == 2) { 51 | mailbox = QString::fromLocal8Bit(argv[1]); 52 | } 53 | 54 | auto job = QGpgME::openpgp()->keyForMailboxJob(); 55 | GpgME::Key k; 56 | GpgME::UserID uid; 57 | job->exec(mailbox, true, k, uid); 58 | qDebug() << "UID Name: " << uid.name() << " Mail: " << uid.email() << " id: " << uid.id(); 59 | qDebug() << "Key fpr: " << k.primaryFingerprint(); 60 | return 0; 61 | } 62 | -------------------------------------------------------------------------------- /src/cleaner.h: -------------------------------------------------------------------------------- 1 | /* 2 | cleaner.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2023 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #ifndef __QGPGME_CLEANER_H__ 35 | #define __QGPGME_CLEANER_H__ 36 | 37 | #include 38 | #include 39 | #include 40 | 41 | /** Helper class that tries to remove files at regular intervals and on destruction. */ 42 | class Cleaner : public QObject 43 | { 44 | Q_OBJECT 45 | public: 46 | /** Tries to remove the file. If this fails it creates a Cleaner for the file. */ 47 | static void removeFile(const QString &filePath); 48 | 49 | private: 50 | explicit Cleaner(const QString &filePath, QObject *parent=nullptr); 51 | ~Cleaner() override; 52 | 53 | Q_DISABLE_COPY_MOVE(Cleaner) 54 | 55 | private: 56 | QString mFilePath; 57 | QTimer mTimer; 58 | }; 59 | 60 | #endif // __QGPGME_CLEANER_H__ 61 | -------------------------------------------------------------------------------- /src/qgpgmegpgcardjob.h: -------------------------------------------------------------------------------- 1 | /* qgpgmegpgcardjob.h 2 | 3 | This file is part of libkleopatra, the KDE keymanagement library 4 | Copyright (c) 2020 g10 Code GmbH 5 | 6 | QGpgME is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU General Public License as 8 | published by the Free Software Foundation; either version 2 of the 9 | License, or (at your option) any later version. 10 | 11 | QGpgME is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | 20 | In addition, as a special exception, the copyright holders give 21 | permission to link the code of this program with any edition of 22 | the Qt library by Trolltech AS, Norway (or with modified versions 23 | of Qt that use the same license as Qt), and distribute linked 24 | combinations including the two. You must obey the GNU General 25 | Public License in all respects for all of the code used other than 26 | Qt. If you modify this file, you may extend this exception to 27 | your version of the file, but you are not obligated to do so. If 28 | you do not wish to do so, delete this exception statement from 29 | your version. 30 | */ 31 | 32 | #ifndef __QGPGME_QGPGMEGPGCARDJOB_H__ 33 | #define __QGPGME_QGPGMEGPGCARDJOB_H__ 34 | #include "gpgcardjob.h" 35 | 36 | #include "threadedjobmixin.h" 37 | 38 | namespace QGpgME 39 | { 40 | 41 | class QGpgMEGpgCardJob 42 | #ifdef Q_MOC_RUN 43 | : public GpgCardJob 44 | #else 45 | : public _detail::ThreadedJobMixin > 46 | #endif 47 | { 48 | Q_OBJECT 49 | #ifdef Q_MOC_RUN 50 | public Q_SLOTS: 51 | void slotFinished(); 52 | #endif 53 | public: 54 | explicit QGpgMEGpgCardJob(); 55 | ~QGpgMEGpgCardJob(); 56 | 57 | GpgME::Error start(const QStringList &cmds) override; 58 | 59 | GpgME::Error exec(const QStringList &cmds, QString &std_out, QString &std_err, int &exitCode) override; 60 | }; 61 | 62 | } 63 | #endif 64 | -------------------------------------------------------------------------------- /src/debug.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | debug.cpp 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2020 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #ifdef HAVE_CONFIG_H 35 | #include "config.h" 36 | #endif 37 | 38 | #include 39 | #include "debug.h" 40 | 41 | #include 42 | 43 | QDebug operator<<(QDebug debug, const GpgME::Error &err) 44 | { 45 | #ifdef Q_OS_WIN 46 | // On Windows, we tell libgpg-error to return (translated) error messages as UTF-8 47 | const auto errAsString = QString::fromStdString(err.asStdString()); 48 | #else 49 | const auto errAsString = QString::fromLocal8Bit(err.asStdString().c_str()); 50 | #endif 51 | const bool oldSetting = debug.autoInsertSpaces(); 52 | debug.nospace() << errAsString << " (code: " << err.code() << ", source: " << err.source() << ")"; 53 | debug.setAutoInsertSpaces(oldSetting); 54 | return debug.maybeSpace(); 55 | } 56 | -------------------------------------------------------------------------------- /src/wkdrefreshjob.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | wkdrefreshjob.cpp 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2023 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #ifdef HAVE_CONFIG_H 35 | #include "config.h" 36 | #endif 37 | 38 | #include "wkdrefreshjob.h" 39 | #include "wkdrefreshjob_p.h" 40 | 41 | using namespace QGpgME; 42 | 43 | WKDRefreshJob::WKDRefreshJob(std::unique_ptr dd, QObject *parent) 44 | : AbstractImportJob{std::move(dd), parent} 45 | { 46 | } 47 | 48 | WKDRefreshJob::~WKDRefreshJob() = default; 49 | 50 | GpgME::Error WKDRefreshJob::start(const std::vector &keys) 51 | { 52 | Q_D(WKDRefreshJob); 53 | d->m_keys = keys; 54 | return d->startIt(); 55 | } 56 | 57 | GpgME::Error WKDRefreshJob::start(const std::vector &userIDs) 58 | { 59 | Q_D(WKDRefreshJob); 60 | d->m_userIds = userIDs; 61 | return d->startIt(); 62 | } 63 | 64 | #include "moc_wkdrefreshjob.cpp" 65 | -------------------------------------------------------------------------------- /cmake/modules/ecm_uninstall.cmake.in: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Alex Merry 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions 5 | # are met: 6 | # 7 | # 1. Redistributions of source code must retain the copyright 8 | # notice, this list of conditions and the following disclaimer. 9 | # 2. Redistributions in binary form must reproduce the copyright 10 | # notice, this list of conditions and the following disclaimer in the 11 | # documentation and/or other materials provided with the distribution. 12 | # 3. The name of the author may not be used to endorse or promote products 13 | # derived from this software without specific prior written permission. 14 | # 15 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 | # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 | # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 | # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | # 26 | # SPDX-License-Identifier: BSD-3-Clause 27 | 28 | if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") 29 | message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt") 30 | endif() 31 | 32 | file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files) 33 | string(REGEX REPLACE "\n" ";" files "${files}") 34 | foreach(file ${files}) 35 | message(STATUS "Uninstalling $ENV{DESTDIR}${file}") 36 | if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") 37 | execute_process( 38 | COMMAND "@CMAKE_COMMAND@" -E remove "$ENV{DESTDIR}${file}" 39 | RESULT_VARIABLE rm_retval 40 | ) 41 | if(NOT "${rm_retval}" STREQUAL 0) 42 | message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") 43 | endif() 44 | else() 45 | message(STATUS "File $ENV{DESTDIR}${file} does not exist.") 46 | endif() 47 | endforeach() 48 | -------------------------------------------------------------------------------- /src/qgpgmesetprimaryuseridjob.h: -------------------------------------------------------------------------------- 1 | /* 2 | qgpgmesetprimaryuseridjob.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2022 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #ifndef __QGPGME_QGPGMESETPRIMARYUSERIDJOB_H__ 35 | #define __QGPGME_QGPGMESETPRIMARYUSERIDJOB_H__ 36 | 37 | #include "setprimaryuseridjob.h" 38 | #include "threadedjobmixin.h" 39 | 40 | namespace QGpgME 41 | { 42 | 43 | class QGpgMESetPrimaryUserIDJob 44 | #ifdef Q_MOC_RUN 45 | : public SetPrimaryUserIDJob 46 | #else 47 | : public _detail::ThreadedJobMixin 48 | #endif 49 | { 50 | Q_OBJECT 51 | #ifdef Q_MOC_RUN 52 | public Q_SLOTS: 53 | void slotFinished(); 54 | #endif 55 | public: 56 | explicit QGpgMESetPrimaryUserIDJob(GpgME::Context *context); 57 | ~QGpgMESetPrimaryUserIDJob() override; 58 | 59 | GpgME::Error start(const GpgME::UserID &userId) override; 60 | }; 61 | 62 | } 63 | 64 | #endif // __QGPGME_QGPGMESETPRIMARYUSERIDJOB_H__ 65 | -------------------------------------------------------------------------------- /cmake/modules/g10_generate_ChangeLog.cmake.in: -------------------------------------------------------------------------------- 1 | # Copyright 2025 g10 Code GmbH 2 | # Software engineering by Ingo Klöcker 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions 6 | # are met: 7 | # 8 | # 1. Redistributions of source code must retain the above copyright 9 | # notice, this list of conditions and the following disclaimer. 10 | # 2. Redistributions in binary form must reproduce the above copyright 11 | # notice, this list of conditions and the following disclaimer in the 12 | # documentation and/or other materials provided with the distribution. 13 | # 14 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR 15 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 16 | # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17 | # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 18 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19 | # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | # 25 | # SPDX-License-Identifier: BSD-2-Clause 26 | 27 | find_package(Git QUIET REQUIRED) 28 | if(NOT EXISTS "@CMAKE_SOURCE_DIR@/.git") 29 | message(FATAL_ERROR "Cannot generate ChangeLog without git repo.") 30 | endif() 31 | 32 | find_program(GITLOG_TO_CHANGELOG gitlog-to-changelog) 33 | if(GITLOG_TO_CHANGELOG STREQUAL "GITLOG_TO_CHANGELOG-NOTFOUND") 34 | message(FATAL_ERROR "Could not find gitlog-to-changelog. A suitable gitlog-to-changelog script can be found in GnuPG master.") 35 | endif() 36 | 37 | if(NOT "@changelog_footer@" STREQUAL "") 38 | file(READ @changelog_footer@ footer) 39 | endif() 40 | if(NOT "@changelog_since@" STREQUAL "") 41 | set(since_args --since "@changelog_since@") 42 | endif() 43 | execute_process( 44 | COMMAND "${GITLOG_TO_CHANGELOG}" --append-dot --tear-off ${since_args} 45 | OUTPUT_FILE @CMAKE_BINARY_DIR@/ChangeLog 46 | WORKING_DIRECTORY "@CMAKE_SOURCE_DIR@" 47 | COMMAND_ERROR_IS_FATAL ANY 48 | ) 49 | if(footer) 50 | file(APPEND @CMAKE_BINARY_DIR@/ChangeLog "${footer}") 51 | endif() 52 | -------------------------------------------------------------------------------- /tests/run-receivekeysjob.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | run-receivekeysjob.cpp 3 | 4 | This file is part of QGpgME's test suite. 5 | Copyright (c) 2022 by g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License, 10 | version 2, as published by the Free Software Foundation. 11 | 12 | QGpgME is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | 21 | In addition, as a special exception, the copyright holders give 22 | permission to link the code of this program with any edition of 23 | the Qt library by Trolltech AS, Norway (or with modified versions 24 | of Qt that use the same license as Qt), and distribute linked 25 | combinations including the two. You must obey the GNU General 26 | Public License in all respects for all of the code used other than 27 | Qt. If you modify this file, you may extend this exception to 28 | your version of the file, but you are not obligated to do so. If 29 | you do not wish to do so, delete this exception statement from 30 | your version. 31 | */ 32 | 33 | #ifdef HAVE_CONFIG_H 34 | #include "config.h" 35 | #endif 36 | 37 | #include 38 | #include 39 | #include 40 | #include 41 | 42 | #include 43 | #include 44 | 45 | #include 46 | 47 | int main(int argc, char **argv) 48 | { 49 | GpgME::initializeLibrary(); 50 | 51 | if (argc < 2) { 52 | std::cerr << "Usage: " << argv[0] << " KEYID..." << std::endl; 53 | return 1; 54 | } 55 | 56 | QCoreApplication app(argc, argv); 57 | const QStringList keyIds = qApp->arguments().mid(1); 58 | 59 | auto job = QGpgME::openpgp()->receiveKeysJob(); 60 | const auto result = job->exec(keyIds); 61 | 62 | std::cout << "Result: " << result.error() << std::endl; 63 | std::cout << "Details:\n" << result << std::endl; 64 | 65 | return 0; 66 | } 67 | -------------------------------------------------------------------------------- /src/qgpgmechangepasswdjob.h: -------------------------------------------------------------------------------- 1 | /* 2 | qgpgmechangepasswdjob.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2010 Klarälvdalens Datakonsult AB 6 | Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik 7 | Software engineering by Intevation GmbH 8 | 9 | QGpgME is free software; you can redistribute it and/or 10 | modify it under the terms of the GNU General Public License as 11 | published by the Free Software Foundation; either version 2 of the 12 | License, or (at your option) any later version. 13 | 14 | QGpgME is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with this program; if not, write to the Free Software 21 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | 23 | In addition, as a special exception, the copyright holders give 24 | permission to link the code of this program with any edition of 25 | the Qt library by Trolltech AS, Norway (or with modified versions 26 | of Qt that use the same license as Qt), and distribute linked 27 | combinations including the two. You must obey the GNU General 28 | Public License in all respects for all of the code used other than 29 | Qt. If you modify this file, you may extend this exception to 30 | your version of the file, but you are not obligated to do so. If 31 | you do not wish to do so, delete this exception statement from 32 | your version. 33 | */ 34 | 35 | #ifndef __QGPGME_QGPGMECHANGEPASSWDJOB_H__ 36 | #define __QGPGME_QGPGMECHANGEPASSWDJOB_H__ 37 | 38 | #include "changepasswdjob.h" 39 | 40 | #include "threadedjobmixin.h" 41 | 42 | namespace QGpgME 43 | { 44 | 45 | class QGpgMEChangePasswdJob 46 | #ifdef Q_MOC_RUN 47 | : public ChangePasswdJob 48 | #else 49 | : public _detail::ThreadedJobMixin 50 | #endif 51 | { 52 | Q_OBJECT 53 | #ifdef Q_MOC_RUN 54 | private Q_SLOTS: 55 | void slotFinished(); 56 | #endif 57 | public: 58 | explicit QGpgMEChangePasswdJob(GpgME::Context *context); 59 | ~QGpgMEChangePasswdJob(); 60 | 61 | /* from ChangePasswdJob */ 62 | GpgME::Error start(const GpgME::Key &key) override; 63 | }; 64 | 65 | } 66 | 67 | #endif // __QGPGME_QGPGMECHANGEPASSWDJOB_H__ 68 | -------------------------------------------------------------------------------- /src/qgpgmetofupolicyjob.h: -------------------------------------------------------------------------------- 1 | /* qgpgmetofupolicyjob.h 2 | 3 | Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik 4 | Software engineering by Intevation GmbH 5 | 6 | QGpgME is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU General Public License as 8 | published by the Free Software Foundation; either version 2 of the 9 | License, or (at your option) any later version. 10 | 11 | QGpgME is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License along 17 | with this program; if not, write to the Free Software Foundation, Inc., 18 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | 20 | In addition, as a special exception, the copyright holders give 21 | permission to link the code of this program with any edition of 22 | the Qt library by Trolltech AS, Norway (or with modified versions 23 | of Qt that use the same license as Qt), and distribute linked 24 | combinations including the two. You must obey the GNU General 25 | Public License in all respects for all of the code used other than 26 | Qt. If you modify this file, you may extend this exception to 27 | your version of the file, but you are not obligated to do so. If 28 | you do not wish to do so, delete this exception statement from 29 | your version. 30 | */ 31 | #ifndef QGPGME_QGPGMETOFUPOLICYJOB_H 32 | #define QGPGME_QGPGMETOFUPOLICYJOB_H 33 | 34 | #include "tofupolicyjob.h" 35 | 36 | #include "threadedjobmixin.h" 37 | namespace GpgME 38 | { 39 | class Key; 40 | } // namespace GpgME 41 | 42 | namespace QGpgME { 43 | 44 | class QGpgMETofuPolicyJob 45 | #ifdef Q_MOC_RUN 46 | : public TofuPolicyJob 47 | #else 48 | : public _detail::ThreadedJobMixin > 49 | #endif 50 | { 51 | Q_OBJECT 52 | #ifdef Q_MOC_RUN 53 | public Q_SLOTS: 54 | void slotFinished(); 55 | #endif 56 | public: 57 | explicit QGpgMETofuPolicyJob(GpgME::Context *context); 58 | ~QGpgMETofuPolicyJob(); 59 | 60 | void start(const GpgME::Key &key, GpgME::TofuInfo::Policy policy) override; 61 | GpgME::Error exec(const GpgME::Key &key, GpgME::TofuInfo::Policy policy) override; 62 | }; 63 | 64 | } 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /cmake/modules/ECMMarkNonGuiExecutable.cmake: -------------------------------------------------------------------------------- 1 | # Copyright 2012 Stephen Kelly 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions 5 | # are met: 6 | # 7 | # 1. Redistributions of source code must retain the copyright 8 | # notice, this list of conditions and the following disclaimer. 9 | # 2. Redistributions in binary form must reproduce the copyright 10 | # notice, this list of conditions and the following disclaimer in the 11 | # documentation and/or other materials provided with the distribution. 12 | # 3. The name of the author may not be used to endorse or promote products 13 | # derived from this software without specific prior written permission. 14 | # 15 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 | # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 | # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 | # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | # 26 | # SPDX-License-Identifier: BSD-3-Clause 27 | 28 | #[=======================================================================[.rst: 29 | ECMMarkNonGuiExecutable 30 | ----------------------- 31 | 32 | Marks an executable target as not being a GUI application. 33 | 34 | :: 35 | 36 | ecm_mark_nongui_executable( [ [...]]) 37 | 38 | This will indicate to CMake that the specified targets should not be included 39 | in a MACOSX_BUNDLE and should not be WIN32_EXECUTABLEs. On platforms other 40 | than MacOS X or Windows, this will have no effect. 41 | 42 | Since pre-1.0.0. 43 | #]=======================================================================] 44 | 45 | function(ecm_mark_nongui_executable) 46 | foreach(_target ${ARGN}) 47 | set_target_properties(${_target} 48 | PROPERTIES 49 | WIN32_EXECUTABLE FALSE 50 | MACOSX_BUNDLE FALSE 51 | ) 52 | endforeach() 53 | endfunction() 54 | -------------------------------------------------------------------------------- /src/qgpgmeadduseridjob.h: -------------------------------------------------------------------------------- 1 | /* 2 | qgpgmeadduseridjob.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2008 Klarälvdalens Datakonsult AB 6 | Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik 7 | Software engineering by Intevation GmbH 8 | 9 | QGpgME is free software; you can redistribute it and/or 10 | modify it under the terms of the GNU General Public License as 11 | published by the Free Software Foundation; either version 2 of the 12 | License, or (at your option) any later version. 13 | 14 | QGpgME is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with this program; if not, write to the Free Software 21 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | 23 | In addition, as a special exception, the copyright holders give 24 | permission to link the code of this program with any edition of 25 | the Qt library by Trolltech AS, Norway (or with modified versions 26 | of Qt that use the same license as Qt), and distribute linked 27 | combinations including the two. You must obey the GNU General 28 | Public License in all respects for all of the code used other than 29 | Qt. If you modify this file, you may extend this exception to 30 | your version of the file, but you are not obligated to do so. If 31 | you do not wish to do so, delete this exception statement from 32 | your version. 33 | */ 34 | 35 | #ifndef __QGPGME_QGPGMEADDUSERIDJOB_H__ 36 | #define __QGPGME_QGPGMEADDUSERIDJOB_H__ 37 | 38 | #include "adduseridjob.h" 39 | 40 | #include "threadedjobmixin.h" 41 | 42 | namespace QGpgME 43 | { 44 | 45 | class QGpgMEAddUserIDJob 46 | #ifdef Q_MOC_RUN 47 | : public AddUserIDJob 48 | #else 49 | : public _detail::ThreadedJobMixin 50 | #endif 51 | { 52 | Q_OBJECT 53 | #ifdef Q_MOC_RUN 54 | private Q_SLOTS: 55 | void slotFinished(); 56 | #endif 57 | public: 58 | explicit QGpgMEAddUserIDJob(GpgME::Context *context); 59 | ~QGpgMEAddUserIDJob(); 60 | 61 | /* from AddUserIDJob */ 62 | GpgME::Error start(const GpgME::Key &key, const QString &name, const QString &email, const QString &comment) override; 63 | }; 64 | } 65 | 66 | #endif // __QGPGME_QGPGMEADDUSERIDJOB_H__ 67 | -------------------------------------------------------------------------------- /src/setprimaryuseridjob.h: -------------------------------------------------------------------------------- 1 | /* 2 | setprimaryuseridjob.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2022 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #ifndef __QGPGME_SETPRIMARYUSERIDJOB_H__ 35 | #define __QGPGME_SETPRIMARYUSERIDJOB_H__ 36 | 37 | #include "job.h" 38 | 39 | #include "qgpgme_export.h" 40 | 41 | namespace GpgME 42 | { 43 | class Error; 44 | class UserID; 45 | } 46 | 47 | namespace QGpgME 48 | { 49 | 50 | class QGPGME_EXPORT SetPrimaryUserIDJob : public Job 51 | { 52 | Q_OBJECT 53 | public: 54 | explicit SetPrimaryUserIDJob(QObject *parent); 55 | ~SetPrimaryUserIDJob() override; 56 | 57 | /** 58 | * Starts setting user ID \a userId as the primary user ID. 59 | */ 60 | virtual GpgME::Error start(const GpgME::UserID &userId) = 0; 61 | 62 | Q_SIGNALS: 63 | void result(const GpgME::Error &error, 64 | const QString &auditLogAsHtml = QString(), const GpgME::Error &auditLogError = GpgME::Error()); 65 | }; 66 | 67 | } 68 | 69 | #endif // __QGPGME_SETPRIMARYUSERIDJOB_H__ 70 | -------------------------------------------------------------------------------- /src/abstractimportjob.h: -------------------------------------------------------------------------------- 1 | /* 2 | abstractimportjob.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2009 Klarälvdalens Datakonsult AB 6 | Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik 7 | Software engineering by Intevation GmbH 8 | 9 | QGpgME is free software; you can redistribute it and/or 10 | modify it under the terms of the GNU General Public License as 11 | published by the Free Software Foundation; either version 2 of the 12 | License, or (at your option) any later version. 13 | 14 | QGpgME is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with this program; if not, write to the Free Software 21 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | 23 | In addition, as a special exception, the copyright holders give 24 | permission to link the code of this program with any edition of 25 | the Qt library by Trolltech AS, Norway (or with modified versions 26 | of Qt that use the same license as Qt), and distribute linked 27 | combinations including the two. You must obey the GNU General 28 | Public License in all respects for all of the code used other than 29 | Qt. If you modify this file, you may extend this exception to 30 | your version of the file, but you are not obligated to do so. If 31 | you do not wish to do so, delete this exception statement from 32 | your version. 33 | */ 34 | 35 | #ifndef __KLEO_ABSTRACTIMPORTJOB_H__ 36 | #define __KLEO_ABSTRACTIMPORTJOB_H__ 37 | 38 | #include "job.h" 39 | 40 | #include "qgpgme_export.h" 41 | 42 | namespace GpgME 43 | { 44 | class Error; 45 | class ImportResult; 46 | } 47 | 48 | namespace QGpgME 49 | { 50 | 51 | class AbstractImportJobPrivate; 52 | 53 | class QGPGME_EXPORT AbstractImportJob : public Job 54 | { 55 | Q_OBJECT 56 | protected: 57 | explicit AbstractImportJob(std::unique_ptr, QObject *parent); 58 | explicit AbstractImportJob(QObject *parent); 59 | public: 60 | ~AbstractImportJob(); 61 | 62 | Q_SIGNALS: 63 | void result(const GpgME::ImportResult &result, const QString &auditLogAsHtml = QString(), const GpgME::Error &auditLogError = GpgME::Error()); 64 | }; 65 | 66 | } 67 | 68 | #endif // __KLEO_IMPORTJOB_H__ 69 | -------------------------------------------------------------------------------- /src/qgpgmewkdrefreshjob.h: -------------------------------------------------------------------------------- 1 | /* 2 | qgpgmewkdrefreshjob.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2023 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #ifndef __QGPGME_QGPGMEWKDREFRESHJOB_H__ 35 | #define __QGPGME_QGPGMEWKDREFRESHJOB_H__ 36 | 37 | #include "threadedjobmixin.h" 38 | #include "wkdrefreshjob.h" 39 | 40 | #include 41 | 42 | namespace QGpgME 43 | { 44 | 45 | class QGpgMEWKDRefreshJobPrivate; 46 | 47 | class QGpgMEWKDRefreshJob 48 | #ifdef Q_MOC_RUN 49 | : public WKDRefreshJob 50 | #else 51 | : public _detail::ThreadedJobMixin> 52 | #endif 53 | { 54 | Q_OBJECT 55 | #ifdef Q_MOC_RUN 56 | public Q_SLOTS: 57 | void slotFinished(); 58 | #endif 59 | public: 60 | explicit QGpgMEWKDRefreshJob(GpgME::Context *context); 61 | ~QGpgMEWKDRefreshJob() override; 62 | 63 | private: 64 | Q_DECLARE_PRIVATE(QGpgMEWKDRefreshJob) 65 | }; 66 | 67 | } 68 | 69 | #endif // __QGPGME_QGPGMEWKDREFRESHJOB_H__ 70 | -------------------------------------------------------------------------------- /src/qgpgmechangeownertrustjob.h: -------------------------------------------------------------------------------- 1 | /* 2 | qgpgmechangeownertrustjob.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2008 Klarälvdalens Datakonsult AB 6 | Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik 7 | Software engineering by Intevation GmbH 8 | 9 | QGpgME is free software; you can redistribute it and/or 10 | modify it under the terms of the GNU General Public License as 11 | published by the Free Software Foundation; either version 2 of the 12 | License, or (at your option) any later version. 13 | 14 | QGpgME is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with this program; if not, write to the Free Software 21 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | 23 | In addition, as a special exception, the copyright holders give 24 | permission to link the code of this program with any edition of 25 | the Qt library by Trolltech AS, Norway (or with modified versions 26 | of Qt that use the same license as Qt), and distribute linked 27 | combinations including the two. You must obey the GNU General 28 | Public License in all respects for all of the code used other than 29 | Qt. If you modify this file, you may extend this exception to 30 | your version of the file, but you are not obligated to do so. If 31 | you do not wish to do so, delete this exception statement from 32 | your version. 33 | */ 34 | 35 | #ifndef __QGPGME_QGPGMECHANGEOWNERTRUSTJOB_H__ 36 | #define __QGPGME_QGPGMECHANGEOWNERTRUSTJOB_H__ 37 | 38 | #include "changeownertrustjob.h" 39 | 40 | #include "threadedjobmixin.h" 41 | 42 | namespace QGpgME 43 | { 44 | 45 | class QGpgMEChangeOwnerTrustJob 46 | #ifdef Q_MOC_RUN 47 | : public ChangeOwnerTrustJob 48 | #else 49 | : public _detail::ThreadedJobMixin 50 | #endif 51 | { 52 | Q_OBJECT 53 | #ifdef Q_MOC_RUN 54 | private Q_SLOTS: 55 | void slotFinished(); 56 | #endif 57 | public: 58 | explicit QGpgMEChangeOwnerTrustJob(GpgME::Context *context); 59 | ~QGpgMEChangeOwnerTrustJob(); 60 | 61 | /* from ChangeOwnerTrustJob */ 62 | GpgME::Error start(const GpgME::Key &key, GpgME::Key::OwnerTrust trust) override; 63 | }; 64 | } 65 | 66 | #endif // __QGPGME_QGPGMECHANGEOWNERTRUSTJOB_H__ 67 | -------------------------------------------------------------------------------- /src/qgpgmereceivekeysjob.h: -------------------------------------------------------------------------------- 1 | /* 2 | qgpgmereceivekeysjob.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2022 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #ifndef __QGPGME_QGPGMERECEIVEKEYSJOB_H__ 35 | #define __QGPGME_QGPGMERECEIVEKEYSJOB_H__ 36 | 37 | #include "receivekeysjob.h" 38 | 39 | #include "threadedjobmixin.h" 40 | 41 | #include 42 | 43 | namespace QGpgME 44 | { 45 | 46 | class QGpgMEReceiveKeysJob 47 | #ifdef Q_MOC_RUN 48 | : public ReceiveKeysJob 49 | #else 50 | : public _detail::ThreadedJobMixin> 51 | #endif 52 | { 53 | Q_OBJECT 54 | #ifdef Q_MOC_RUN 55 | public Q_SLOTS: 56 | void slotFinished(); 57 | #endif 58 | public: 59 | explicit QGpgMEReceiveKeysJob(GpgME::Context *context); 60 | ~QGpgMEReceiveKeysJob() override; 61 | 62 | GpgME::Error start(const QStringList &keyIds) override; 63 | 64 | GpgME::ImportResult exec(const QStringList &keyIds) override; 65 | }; 66 | 67 | } 68 | 69 | #endif // __QGPGME_QGPGMERECEIVEKEYSJOB_H__ 70 | -------------------------------------------------------------------------------- /src/receivekeysjob.h: -------------------------------------------------------------------------------- 1 | /* 2 | receivekeysjob.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2022 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #ifndef __QGPGME_RECEIVEKEYSJOB_H__ 35 | #define __QGPGME_RECEIVEKEYSJOB_H__ 36 | 37 | #include "abstractimportjob.h" 38 | #include "qgpgme_export.h" 39 | 40 | namespace QGpgME 41 | { 42 | 43 | class QGPGME_EXPORT ReceiveKeysJob : public AbstractImportJob 44 | { 45 | Q_OBJECT 46 | protected: 47 | explicit ReceiveKeysJob(QObject *parent); 48 | public: 49 | ~ReceiveKeysJob() override; 50 | 51 | /** 52 | Starts the import of keys from a keyserver. \a keyIds is a list of 53 | key ids and/or fingerprints specifying the keys to import. 54 | */ 55 | virtual GpgME::Error start(const QStringList &keyIds) = 0; 56 | 57 | /** 58 | Runs the import of keys from a keyserver. \a keyIds is a list of 59 | key ids and/or fingerprints specifying the keys to import. 60 | */ 61 | virtual GpgME::ImportResult exec(const QStringList &keyIds) = 0; 62 | }; 63 | 64 | } 65 | 66 | #endif // __QGPGME_RECEIVEKEYSJOB_H__ 67 | -------------------------------------------------------------------------------- /src/quickjob_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | quickjob_p.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2024 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #ifndef __QGPGME_QUICKJOB_P_H__ 35 | #define __QGPGME_QUICKJOB_P_H__ 36 | 37 | #include "job_p.h" 38 | 39 | #include "quickjob.h" 40 | 41 | namespace QGpgME 42 | { 43 | 44 | class QuickJobPrivate : public JobPrivate 45 | { 46 | public: 47 | virtual GpgME::Error startCreate(const QString &uid, 48 | const QByteArray &algo, 49 | const QDateTime &expires, 50 | GpgME::Context::CreationFlags flags) = 0; 51 | 52 | virtual GpgME::Error startAddSubkey(const GpgME::Key &key, 53 | const QByteArray &algo, 54 | const QDateTime &expires, 55 | GpgME::Context::CreationFlags flags) = 0; 56 | 57 | virtual GpgME::Error startSetKeyEnabled(const GpgME::Key &key, bool enabled) = 0; 58 | }; 59 | 60 | } 61 | 62 | #endif // __QGPGME_QUICKJOB_P_H__ 63 | -------------------------------------------------------------------------------- /src/qgpgmewkdlookupjob.h: -------------------------------------------------------------------------------- 1 | /* 2 | qgpgmewkdlookupjob.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2021 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #ifndef __QGPGME_QGPGMEWKDLOOKUPJOB_H__ 35 | #define __QGPGME_QGPGMEWKDLOOKUPJOB_H__ 36 | 37 | #include "threadedjobmixin.h" 38 | #include "wkdlookupjob.h" 39 | #include "wkdlookupresult.h" 40 | 41 | namespace QGpgME 42 | { 43 | class WKDLookupResult; 44 | 45 | class QGpgMEWKDLookupJob 46 | #ifdef Q_MOC_RUN 47 | : public WKDLookupJob 48 | #else 49 | : public _detail::ThreadedJobMixin > 50 | #endif 51 | { 52 | Q_OBJECT 53 | #ifdef Q_MOC_RUN 54 | public Q_SLOTS: 55 | void slotFinished(); 56 | #endif 57 | public: 58 | explicit QGpgMEWKDLookupJob(GpgME::Context *context); 59 | ~QGpgMEWKDLookupJob(); 60 | 61 | /* from WKDLookupJob */ 62 | GpgME::Error start(const QString &email) override; 63 | 64 | /* from WKDLookupJob */ 65 | WKDLookupResult exec(const QString &email) override; 66 | }; 67 | 68 | } 69 | 70 | #endif // __QGPGME_QGPGMEWKDLOOKUPJOB_H__ 71 | -------------------------------------------------------------------------------- /src/changeexpiryjob.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | changeexpiryjob.cpp 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2021 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #ifdef HAVE_CONFIG_H 35 | #include "config.h" 36 | #endif 37 | 38 | #include "changeexpiryjob.h" 39 | #include "changeexpiryjob_p.h" 40 | 41 | #include 42 | 43 | using namespace GpgME; 44 | using namespace QGpgME; 45 | 46 | ChangeExpiryJob::ChangeExpiryJob(std::unique_ptr dd, QObject *parent) 47 | : Job{std::move(dd), parent} 48 | { 49 | } 50 | 51 | ChangeExpiryJob::~ChangeExpiryJob() = default; 52 | 53 | void ChangeExpiryJob::setOptions(ChangeExpiryJob::Options options) 54 | { 55 | Q_D(ChangeExpiryJob); 56 | d->m_options = options; 57 | } 58 | 59 | ChangeExpiryJob::Options ChangeExpiryJob::options() const 60 | { 61 | Q_D(const ChangeExpiryJob); 62 | return d->m_options; 63 | } 64 | 65 | /* For ABI compat not pure virtual. */ 66 | Error ChangeExpiryJob::start(const Key &, const QDateTime &, const std::vector &) 67 | { 68 | return {}; 69 | } 70 | 71 | #include "moc_changeexpiryjob.cpp" 72 | -------------------------------------------------------------------------------- /INSTALL.md: -------------------------------------------------------------------------------- 1 | # Installation Instructions 2 | 3 | Copyright 2025 g10 Code GmbH 4 | 5 | This file is free software; as a special exception the author gives 6 | unlimited permission to copy and/or distribute it, with or without 7 | modifications, as long as this notice is preserved. 8 | 9 | This file is distributed in the hope that it will be useful, but 10 | WITHOUT ANY WARRANTY, to the extent permitted by law; without even the 11 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 12 | PURPOSE. 13 | 14 | ## Installation 15 | 16 | We recommend to make an out-of-source build, i.e. do something like 17 | 18 | ``` 19 | mkdir build 20 | cd build 21 | cmake .. 22 | make 23 | make install 24 | ``` 25 | 26 | to configure, build, and install the project. 27 | 28 | ## Configuration 29 | 30 | A few useful project-specific options to pass to cmake are: 31 | 32 | `-DBUILD_WITH_QT5=OFF` 33 | Disables building QGgpME for Qt 5. The default is `ON`. 34 | 35 | `-DBUILD_WITH_QT6=OFF` 36 | Disables building QGgpME for Qt 6. The default is `ON`. 37 | 38 | `-DBUILD_TESTING=OFF` 39 | Disables the build of the tests/examples in the tests folder. 40 | The default is `ON`. 41 | 42 | Some useful general cmake options are: 43 | 44 | `-DCMAKE_BUILD_TYPE=RelWithDebInfo` 45 | Changes the build type to `RelWithDebInfo`. 46 | 47 | `-DCMAKE_INSTALL_PREFIX=/some/path` 48 | Changes the install directory to `/some/path`. 49 | 50 | See the documentation of cmake (https://cmake.org/cmake/help/latest/) 51 | for details. 52 | 53 | ## Packaging 54 | 55 | Run 56 | ``` 57 | make dist 58 | ``` 59 | to create a tarball of the sources. This uses `git archive`, i.e. it 60 | works on a git clone only. The current HEAD is packaged so that you 61 | can run it safely on a dirty working copy. Additionally, to the sources 62 | a VERSION file and a generated ChangeLog file are added to the tarball. 63 | 64 | The following common GnuPG make targets are also supported: 65 | 66 | `make distcheck` 67 | Creates a tarball and runs similar checks as the autotools target 68 | with the same name. 69 | 70 | `make release` 71 | Essentially this runs `make distcheck` to create a release tarball 72 | and generates the data for GnuPG's SWDB. All output is written to a 73 | *.buildlog file. 74 | 75 | `make sign-release` 76 | Signs the release tarball and uploads everything. The necessary 77 | information is read from `~/.gnupg-autogen.rc`. 78 | 79 | `make gen-ChangeLog` 80 | Used implicitly by `make dist` to generate a ChangeLog from the 81 | git history. 82 | 83 | `make gen-swdb` 84 | Used by `make release` to generate the data for GnuPG's SWDB. 85 | -------------------------------------------------------------------------------- /src/qgpgmeaddexistingsubkeyjob.h: -------------------------------------------------------------------------------- 1 | /* 2 | qgpgmeaddexistingsubkeyjob.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2022 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #ifndef __QGPGME_QGPGMEADDEXISTINGSUBKEYJOB_H__ 35 | #define __QGPGME_QGPGMEADDEXISTINGSUBKEYJOB_H__ 36 | 37 | #include "threadedjobmixin.h" 38 | #include "addexistingsubkeyjob.h" 39 | 40 | namespace QGpgME 41 | { 42 | 43 | class QGpgMEAddExistingSubkeyJob 44 | #ifdef Q_MOC_RUN 45 | : public AddExistingSubkeyJob 46 | #else 47 | : public _detail::ThreadedJobMixin 48 | #endif 49 | { 50 | Q_OBJECT 51 | #ifdef Q_MOC_RUN 52 | public Q_SLOTS: 53 | void slotFinished(); 54 | #endif 55 | public: 56 | explicit QGpgMEAddExistingSubkeyJob(GpgME::Context *context); 57 | ~QGpgMEAddExistingSubkeyJob(); 58 | 59 | /* from AddExistingSubkeyJob */ 60 | GpgME::Error start(const GpgME::Key &key, const GpgME::Subkey &subkey) override; 61 | 62 | /* from AddExistingSubkeyJob */ 63 | GpgME::Error exec(const GpgME::Key &key, const GpgME::Subkey &subkey) override; 64 | }; 65 | 66 | } 67 | 68 | #endif // __QGPGME_QGPGMEADDEXISTINGSUBKEYJOB_H__ 69 | -------------------------------------------------------------------------------- /src/gpgcardjob.h: -------------------------------------------------------------------------------- 1 | /* 2 | gpgcardjob.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2020 g10 Code GmbH 6 | 7 | QGpgME is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License as 9 | published by the Free Software Foundation; either version 2 of the 10 | License, or (at your option) any later version. 11 | 12 | QGpgME is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | 21 | In addition, as a special exception, the copyright holders give 22 | permission to link the code of this program with any edition of 23 | the Qt library by Trolltech AS, Norway (or with modified versions 24 | of Qt that use the same license as Qt), and distribute linked 25 | combinations including the two. You must obey the GNU General 26 | Public License in all respects for all of the code used other than 27 | Qt. If you modify this file, you may extend this exception to 28 | your version of the file, but you are not obligated to do so. If 29 | you do not wish to do so, delete this exception statement from 30 | your version. 31 | */ 32 | #ifndef __KLEO_GPGCARDJOB_H__ 33 | #define __KLEO_GPGCARDJOB_H__ 34 | 35 | #include 36 | 37 | #include "job.h" 38 | 39 | namespace GpgME 40 | { 41 | class Error; 42 | } 43 | 44 | namespace QGpgME 45 | { 46 | 47 | class QGPGME_EXPORT GpgCardJob: public Job 48 | { 49 | Q_OBJECT 50 | protected: 51 | explicit GpgCardJob(QObject *parent); 52 | 53 | public: 54 | ~GpgCardJob(); 55 | 56 | /** 57 | Starts the operation. \a cmds are the commands to 58 | execute. 59 | */ 60 | virtual GpgME::Error start(const QStringList &cmds) = 0; 61 | 62 | virtual GpgME::Error exec(const QStringList &cmds, QString &std_out, QString &std_err, int &exitCode) = 0; 63 | 64 | Q_SIGNALS: 65 | /** The resulting stdout and stderr of gpgcard and the exitCode 66 | * 67 | * The auditlog params are always null / empty. 68 | */ 69 | void result(const QString &std_out, const QString &std_err, int exitCode, 70 | const QString &auditLogAsHtml = QString(), const GpgME::Error &auditLogError = GpgME::Error()); 71 | }; 72 | 73 | } 74 | #endif 75 | -------------------------------------------------------------------------------- /src/qgpgmedeletejob.h: -------------------------------------------------------------------------------- 1 | /* 2 | qgpgmedeletejob.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB 6 | Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik 7 | Software engineering by Intevation GmbH 8 | 9 | QGpgME is free software; you can redistribute it and/or 10 | modify it under the terms of the GNU General Public License as 11 | published by the Free Software Foundation; either version 2 of the 12 | License, or (at your option) any later version. 13 | 14 | QGpgME is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with this program; if not, write to the Free Software 21 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | 23 | In addition, as a special exception, the copyright holders give 24 | permission to link the code of this program with any edition of 25 | the Qt library by Trolltech AS, Norway (or with modified versions 26 | of Qt that use the same license as Qt), and distribute linked 27 | combinations including the two. You must obey the GNU General 28 | Public License in all respects for all of the code used other than 29 | Qt. If you modify this file, you may extend this exception to 30 | your version of the file, but you are not obligated to do so. If 31 | you do not wish to do so, delete this exception statement from 32 | your version. 33 | */ 34 | 35 | #ifndef __QGPGME_QGPGMEDELETEJOB_H__ 36 | #define __QGPGME_QGPGMEDELETEJOB_H__ 37 | 38 | #include "deletejob.h" 39 | 40 | #include "threadedjobmixin.h" 41 | 42 | namespace GpgME 43 | { 44 | class Key; 45 | } 46 | 47 | 48 | namespace QGpgME 49 | { 50 | class QGpgMEDeleteJobPrivate; 51 | 52 | class QGpgMEDeleteJob 53 | #ifdef Q_MOC_RUN 54 | : public DeleteJob 55 | #else 56 | : public _detail::ThreadedJobMixin 57 | #endif 58 | { 59 | Q_OBJECT 60 | #ifdef Q_MOC_RUN 61 | public Q_SLOTS: 62 | void slotFinished(); 63 | #endif 64 | public: 65 | explicit QGpgMEDeleteJob(GpgME::Context *context); 66 | ~QGpgMEDeleteJob(); 67 | 68 | /* from DeleteJob */ 69 | GpgME::Error start(const GpgME::Key &key, bool allowSecretKeyDeletion) override; 70 | 71 | private: 72 | Q_DECLARE_PRIVATE(QGpgMEDeleteJob) 73 | }; 74 | 75 | } 76 | 77 | #endif // __QGPGME_QGPGMEDELETEJOB_H__ 78 | -------------------------------------------------------------------------------- /src/qgpgmekeygenerationjob.h: -------------------------------------------------------------------------------- 1 | /* 2 | qgpgmekeygenerationjob.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB 6 | Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik 7 | Software engineering by Intevation GmbH 8 | 9 | QGpgME is free software; you can redistribute it and/or 10 | modify it under the terms of the GNU General Public License as 11 | published by the Free Software Foundation; either version 2 of the 12 | License, or (at your option) any later version. 13 | 14 | QGpgME is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with this program; if not, write to the Free Software 21 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | 23 | In addition, as a special exception, the copyright holders give 24 | permission to link the code of this program with any edition of 25 | the Qt library by Trolltech AS, Norway (or with modified versions 26 | of Qt that use the same license as Qt), and distribute linked 27 | combinations including the two. You must obey the GNU General 28 | Public License in all respects for all of the code used other than 29 | Qt. If you modify this file, you may extend this exception to 30 | your version of the file, but you are not obligated to do so. If 31 | you do not wish to do so, delete this exception statement from 32 | your version. 33 | */ 34 | 35 | #ifndef __QGPGME_QGPGMEKEYGENERATIONJOB_H__ 36 | #define __QGPGME_QGPGMEKEYGENERATIONJOB_H__ 37 | 38 | #include "keygenerationjob.h" 39 | 40 | #include "threadedjobmixin.h" 41 | 42 | #include 43 | 44 | namespace QGpgME 45 | { 46 | 47 | class QGpgMEKeyGenerationJob 48 | #ifdef Q_MOC_RUN 49 | : public KeyGenerationJob 50 | #else 51 | : public _detail::ThreadedJobMixin > 52 | #endif 53 | { 54 | Q_OBJECT 55 | #ifdef Q_MOC_RUN 56 | private Q_SLOTS: 57 | void slotFinished(); 58 | #endif 59 | public: 60 | explicit QGpgMEKeyGenerationJob(GpgME::Context *context); 61 | ~QGpgMEKeyGenerationJob(); 62 | 63 | /* from KeygenerationJob */ 64 | GpgME::Error start(const QString ¶meters) override; 65 | }; 66 | 67 | } 68 | 69 | #endif // __QGPGME_QGPGMEKEYGENERATIONJOB_H__ 70 | -------------------------------------------------------------------------------- /src/qgpgmewkspublishjob.h: -------------------------------------------------------------------------------- 1 | /* qgpgmewkspublishjob.h 2 | 3 | Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik 4 | Software engineering by Intevation GmbH 5 | 6 | QGpgME is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU General Public License as 8 | published by the Free Software Foundation; either version 2 of the 9 | License, or (at your option) any later version. 10 | 11 | QGpgME is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License along 17 | with this program; if not, write to the Free Software Foundation, Inc., 18 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | 20 | In addition, as a special exception, the copyright holders give 21 | permission to link the code of this program with any edition of 22 | the Qt library by Trolltech AS, Norway (or with modified versions 23 | of Qt that use the same license as Qt), and distribute linked 24 | combinations including the two. You must obey the GNU General 25 | Public License in all respects for all of the code used other than 26 | Qt. If you modify this file, you may extend this exception to 27 | your version of the file, but you are not obligated to do so. If 28 | you do not wish to do so, delete this exception statement from 29 | your version. 30 | */ 31 | #ifndef QGPGME_QGPGMEWKSPUBLISHJOB_H 32 | #define QGPGME_QGPGMEWKSPUBLISHJOB_H 33 | 34 | #include "wkspublishjob.h" 35 | 36 | #include "threadedjobmixin.h" 37 | namespace GpgME 38 | { 39 | class Key; 40 | } // namespace GpgME 41 | 42 | namespace QGpgME { 43 | 44 | /** 45 | * Handles Web Key Service Publishing. Needs WKS tools installed and 46 | * server support. 47 | */ 48 | class QGpgMEWKSPublishJob 49 | #ifdef Q_MOC_RUN 50 | : public WKSPublishJob 51 | #else 52 | : public _detail::ThreadedJobMixin > 53 | #endif 54 | { 55 | Q_OBJECT 56 | #ifdef Q_MOC_RUN 57 | public Q_SLOTS: 58 | void slotFinished(); 59 | #endif 60 | public: 61 | explicit QGpgMEWKSPublishJob(GpgME::Context *context); 62 | ~QGpgMEWKSPublishJob(); 63 | 64 | void startCheck(const QString &mailbox) override; 65 | void startCreate(const char *fpr, const QString &mailbox) override; 66 | void startReceive(const QByteArray &response) override; 67 | }; 68 | 69 | } 70 | 71 | #endif 72 | -------------------------------------------------------------------------------- /src/wkdlookupjob.h: -------------------------------------------------------------------------------- 1 | /* 2 | wkdlookupjob.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2021 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #ifndef __QGPGME_WKDLOOKUPJOB_H__ 35 | #define __QGPGME_WKDLOOKUPJOB_H__ 36 | 37 | #include "job.h" 38 | #include "qgpgme_export.h" 39 | 40 | class QString; 41 | 42 | namespace GpgME 43 | { 44 | class Data; 45 | class Error; 46 | } 47 | 48 | namespace QGpgME 49 | { 50 | 51 | class WKDLookupResult; 52 | 53 | class QGPGME_EXPORT WKDLookupJob : public Job 54 | { 55 | Q_OBJECT 56 | protected: 57 | explicit WKDLookupJob(QObject *parent); 58 | 59 | public: 60 | ~WKDLookupJob(); 61 | 62 | /** 63 | Starts a key lookup operation for the email address \a email via WKD. 64 | */ 65 | virtual GpgME::Error start(const QString &email) = 0; 66 | 67 | /** 68 | Runs a key lookup operation for the email address \a email via WKD. 69 | */ 70 | virtual WKDLookupResult exec(const QString &email) = 0; 71 | 72 | Q_SIGNALS: 73 | void result(const WKDLookupResult &result, const QString &auditLogAsHtml = {}, const GpgME::Error &auditLogError = {}); 74 | }; 75 | 76 | } 77 | 78 | #endif // __QGPGME_WKDLOOKUPJOB_H__ 79 | -------------------------------------------------------------------------------- /src/qgpgmedownloadjob.h: -------------------------------------------------------------------------------- 1 | /* 2 | qgpgmedownloadjob.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB 6 | Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik 7 | Software engineering by Intevation GmbH 8 | 9 | QGpgME is free software; you can redistribute it and/or 10 | modify it under the terms of the GNU General Public License as 11 | published by the Free Software Foundation; either version 2 of the 12 | License, or (at your option) any later version. 13 | 14 | QGpgME is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with this program; if not, write to the Free Software 21 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | 23 | In addition, as a special exception, the copyright holders give 24 | permission to link the code of this program with any edition of 25 | the Qt library by Trolltech AS, Norway (or with modified versions 26 | of Qt that use the same license as Qt), and distribute linked 27 | combinations including the two. You must obey the GNU General 28 | Public License in all respects for all of the code used other than 29 | Qt. If you modify this file, you may extend this exception to 30 | your version of the file, but you are not obligated to do so. If 31 | you do not wish to do so, delete this exception statement from 32 | your version. 33 | */ 34 | 35 | #ifndef __QGPGME_QGPGMEDOWNLOADJOB_H__ 36 | #define __QGPGME_QGPGMEDOWNLOADJOB_H__ 37 | 38 | #include "downloadjob.h" 39 | 40 | #include "threadedjobmixin.h" 41 | 42 | namespace QGpgME 43 | { 44 | 45 | class QGpgMEDownloadJob 46 | #ifdef Q_MOC_RUN 47 | : public DownloadJob 48 | #else 49 | : public _detail::ThreadedJobMixin > 50 | #endif 51 | { 52 | Q_OBJECT 53 | #ifdef Q_MOC_RUN 54 | public Q_SLOTS: 55 | void slotFinished(); 56 | #endif 57 | public: 58 | explicit QGpgMEDownloadJob(GpgME::Context *context); 59 | ~QGpgMEDownloadJob(); 60 | 61 | /* from DownloadJob */ 62 | GpgME::Error start(const QStringList &fingerprints) override; 63 | 64 | /* from DownloadJob */ 65 | GpgME::Error start(const QByteArray &fingerprint, const std::shared_ptr &keyData) override; 66 | }; 67 | 68 | } 69 | 70 | #endif // __QGPGME_QGPGMEDOWNLOADJOB_H__ 71 | -------------------------------------------------------------------------------- /src/qgpgmetofupolicyjob.cpp: -------------------------------------------------------------------------------- 1 | /* qgpgmetofupolicyjob.cpp 2 | 3 | Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik 4 | Software engineering by Intevation GmbH 5 | 6 | QGpgME is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU General Public License as 8 | published by the Free Software Foundation; either version 2 of the 9 | License, or (at your option) any later version. 10 | 11 | QGpgME is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License along 17 | with this program; if not, write to the Free Software Foundation, Inc., 18 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | 20 | In addition, as a special exception, the copyright holders give 21 | permission to link the code of this program with any edition of 22 | the Qt library by Trolltech AS, Norway (or with modified versions 23 | of Qt that use the same license as Qt), and distribute linked 24 | combinations including the two. You must obey the GNU General 25 | Public License in all respects for all of the code used other than 26 | Qt. If you modify this file, you may extend this exception to 27 | your version of the file, but you are not obligated to do so. If 28 | you do not wish to do so, delete this exception statement from 29 | your version. 30 | */ 31 | 32 | #ifdef HAVE_CONFIG_H 33 | #include "config.h" 34 | #endif 35 | 36 | #include "qgpgmetofupolicyjob.h" 37 | 38 | #include 39 | #include 40 | #include 41 | 42 | 43 | using namespace QGpgME; 44 | using namespace GpgME; 45 | 46 | QGpgMETofuPolicyJob::QGpgMETofuPolicyJob(Context *context) 47 | : mixin_type(context) 48 | { 49 | lateInitialization(); 50 | } 51 | 52 | QGpgMETofuPolicyJob::~QGpgMETofuPolicyJob() {} 53 | 54 | static QGpgMETofuPolicyJob::result_type policy_worker(Context *ctx, const Key &key, TofuInfo::Policy policy) 55 | { 56 | return std::make_tuple (ctx->setTofuPolicy(key, policy), 57 | QString(), Error()); 58 | } 59 | 60 | void QGpgMETofuPolicyJob::start(const Key &key, TofuInfo::Policy policy) 61 | { 62 | run(std::bind(&policy_worker, std::placeholders::_1, key, policy)); 63 | } 64 | 65 | Error QGpgMETofuPolicyJob::exec(const Key &key, TofuInfo::Policy policy) 66 | { 67 | return std::get<0>(policy_worker(context(), key, policy)); 68 | } 69 | 70 | #include "moc_qgpgmetofupolicyjob.cpp" 71 | -------------------------------------------------------------------------------- /cmake/modules/ECMMarkAsTest.cmake: -------------------------------------------------------------------------------- 1 | # Copyright 2012 Stephen Kelly 2 | # Copyright 2012 Alex Neundorf 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions 6 | # are met: 7 | # 8 | # 1. Redistributions of source code must retain the copyright 9 | # notice, this list of conditions and the following disclaimer. 10 | # 2. Redistributions in binary form must reproduce the copyright 11 | # notice, this list of conditions and the following disclaimer in the 12 | # documentation and/or other materials provided with the distribution. 13 | # 3. The name of the author may not be used to endorse or promote products 14 | # derived from this software without specific prior written permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | # 27 | # SPDX-License-Identifier: BSD-3-Clause 28 | 29 | #[=======================================================================[.rst: 30 | ECMMarkAsTest 31 | ------------- 32 | 33 | Marks a target as only being required for tests. 34 | 35 | :: 36 | 37 | ecm_mark_as_test( [ [...]]) 38 | 39 | This will cause the specified targets to not be built unless either 40 | ``BUILD_TESTING`` is set to ``ON`` or the user invokes the ``buildtests`` target. 41 | 42 | ``BUILD_TESTING`` is created as a cache variable by the CTest module and by the 43 | :kde-module:`KDECMakeSettings` module. 44 | 45 | Since pre-1.0.0. 46 | #]=======================================================================] 47 | 48 | if (NOT BUILD_TESTING) 49 | if(NOT TARGET buildtests) 50 | add_custom_target(buildtests) 51 | endif() 52 | endif() 53 | 54 | function(ecm_mark_as_test) 55 | if (NOT BUILD_TESTING) 56 | foreach(_target ${ARGN}) 57 | set_target_properties(${_target} 58 | PROPERTIES 59 | EXCLUDE_FROM_ALL TRUE 60 | ) 61 | add_dependencies(buildtests ${_target}) 62 | endforeach() 63 | endif() 64 | endfunction() 65 | -------------------------------------------------------------------------------- /src/tofupolicyjob.h: -------------------------------------------------------------------------------- 1 | /* tofupolicyjob.h 2 | 3 | Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik 4 | Software engineering by Intevation GmbH 5 | 6 | QGpgME is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU General Public License as 8 | published by the Free Software Foundation; either version 2 of the 9 | License, or (at your option) any later version. 10 | 11 | QGpgME is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License along 17 | with this program; if not, write to the Free Software Foundation, Inc., 18 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | 20 | In addition, as a special exception, the copyright holders give 21 | permission to link the code of this program with any edition of 22 | the Qt library by Trolltech AS, Norway (or with modified versions 23 | of Qt that use the same license as Qt), and distribute linked 24 | combinations including the two. You must obey the GNU General 25 | Public License in all respects for all of the code used other than 26 | Qt. If you modify this file, you may extend this exception to 27 | your version of the file, but you are not obligated to do so. If 28 | you do not wish to do so, delete this exception statement from 29 | your version. 30 | */ 31 | #ifndef QGPGME_TOFUPOLICYJOB_H 32 | #define QGPGME_TOFUPOLICYJOB_H 33 | 34 | #include "job.h" 35 | 36 | #include "qgpgme_export.h" 37 | 38 | #include 39 | 40 | namespace GpgME 41 | { 42 | class Key; 43 | } // namespace GpgME 44 | 45 | namespace QGpgME { 46 | 47 | /** 48 | * Set the TOFU Policy for a key 49 | */ 50 | class QGPGME_EXPORT TofuPolicyJob: public Job 51 | { 52 | Q_OBJECT 53 | protected: 54 | explicit TofuPolicyJob(QObject *parent); 55 | public: 56 | ~TofuPolicyJob(); 57 | 58 | 59 | /* Set the policy to \a policy see the gpgme manual for 60 | * policy explanations. */ 61 | virtual void start(const GpgME::Key &key, GpgME::TofuInfo::Policy policy) = 0; 62 | 63 | virtual GpgME::Error exec(const GpgME::Key &key, GpgME::TofuInfo::Policy policy) = 0; 64 | 65 | Q_SIGNALS: 66 | /* Result of the operation 67 | * 68 | * As usual auditLogAsHtml and auditLogError can be ignored. 69 | **/ 70 | void result(const GpgME::Error &error, 71 | const QString &auditLogAsHtml = QString(), 72 | const GpgME::Error &auditLogError = GpgME::Error()); 73 | }; 74 | 75 | } 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /src/qgpgmerevokekeyjob.h: -------------------------------------------------------------------------------- 1 | /* 2 | qgpgmerevokekeyjob.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2022 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #ifndef __QGPGME_QGPGMEREVOKEKEYJOB_H__ 35 | #define __QGPGME_QGPGMEREVOKEKEYJOB_H__ 36 | 37 | #include "threadedjobmixin.h" 38 | #include "revokekeyjob.h" 39 | 40 | namespace QGpgME 41 | { 42 | 43 | class QGpgMERevokeKeyJob 44 | #ifdef Q_MOC_RUN 45 | : public RevokeKeyJob 46 | #else 47 | : public _detail::ThreadedJobMixin 48 | #endif 49 | { 50 | Q_OBJECT 51 | #ifdef Q_MOC_RUN 52 | public Q_SLOTS: 53 | void slotFinished(); 54 | #endif 55 | public: 56 | explicit QGpgMERevokeKeyJob(GpgME::Context *context); 57 | ~QGpgMERevokeKeyJob() override; 58 | 59 | GpgME::Error start(const GpgME::Key &key, 60 | GpgME::RevocationReason reason = GpgME::RevocationReason::Unspecified, 61 | const std::vector &description = {}) override; 62 | 63 | GpgME::Error exec(const GpgME::Key &key, 64 | GpgME::RevocationReason reason = GpgME::RevocationReason::Unspecified, 65 | const std::vector &description = {}) override; 66 | }; 67 | 68 | } 69 | 70 | #endif // __QGPGME_QGPGMEREVOKEKEYJOB_H__ 71 | -------------------------------------------------------------------------------- /src/qgpgmesignarchivejob.h: -------------------------------------------------------------------------------- 1 | /* 2 | qgpgmesignarchivejob.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2023 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #ifndef __QGPGME_QGPGMESIGNARCHIVEJOB_H__ 35 | #define __QGPGME_QGPGMESIGNARCHIVEJOB_H__ 36 | 37 | #include "signarchivejob.h" 38 | 39 | #include "threadedjobmixin.h" 40 | 41 | #include 42 | 43 | namespace QGpgME 44 | { 45 | 46 | class QGpgMESignArchiveJobPrivate; 47 | 48 | class QGpgMESignArchiveJob 49 | #ifdef Q_MOC_RUN 50 | : public SignArchiveJob 51 | #else 52 | : public _detail::ThreadedJobMixin> 53 | #endif 54 | { 55 | Q_OBJECT 56 | #ifdef Q_MOC_RUN 57 | public Q_SLOTS: 58 | void slotFinished(); 59 | #endif 60 | public: 61 | explicit QGpgMESignArchiveJob(GpgME::Context *context); 62 | ~QGpgMESignArchiveJob() = default; 63 | 64 | GpgME::Error start(const std::vector &signers, 65 | const std::vector &paths, 66 | const std::shared_ptr &output) override; 67 | 68 | private: 69 | Q_DECLARE_PRIVATE(QGpgMESignArchiveJob) 70 | }; 71 | 72 | } 73 | 74 | #endif // __QGPGME_QGPGMESIGNARCHIVEJOB_H__ 75 | -------------------------------------------------------------------------------- /src/job_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | job_p.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2021 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #ifndef __QGPGME_JOB_P_H__ 35 | #define __QGPGME_JOB_P_H__ 36 | 37 | #include "job.h" 38 | 39 | #include "qgpgme_debug.h" 40 | 41 | // Base class for pimpl classes for Job subclasses 42 | class QGpgME::JobPrivate 43 | { 44 | friend class ::QGpgME::Job; 45 | 46 | public: 47 | Q_DECLARE_PUBLIC(Job) 48 | 49 | JobPrivate() = default; 50 | virtual ~JobPrivate() = default; 51 | 52 | virtual GpgME::Error startIt() = 0; 53 | 54 | virtual void startNow() = 0; 55 | 56 | Job *q_ptr = nullptr; 57 | }; 58 | 59 | // Helper for the archive job classes 60 | template 61 | void emitArchiveProgressSignals(JobClass *job, const QString &what, int type, int current, int total) 62 | { 63 | if (what != QLatin1String{"gpgtar"}) { 64 | return; 65 | } 66 | switch (type) { 67 | case 'c': 68 | Q_EMIT job->fileProgress(current, total); 69 | break; 70 | case 's': 71 | Q_EMIT job->dataProgress(current, total); 72 | break; 73 | default: 74 | qCDebug(QGPGME_LOG) << job << __func__ << "Received progress for gpgtar with unknown type" << char(type); 75 | }; 76 | } 77 | 78 | #endif // __QGPGME_JOB_P_H__ 79 | -------------------------------------------------------------------------------- /src/qgpgmereceivekeysjob.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | qgpgmereceivekeysjob.cpp 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2022 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #ifdef HAVE_CONFIG_H 35 | # include "config.h" 36 | #endif 37 | 38 | #include "qgpgmereceivekeysjob.h" 39 | 40 | #include "util.h" 41 | 42 | using namespace QGpgME; 43 | using namespace GpgME; 44 | 45 | QGpgMEReceiveKeysJob::QGpgMEReceiveKeysJob(Context *context) 46 | : mixin_type{context} 47 | { 48 | lateInitialization(); 49 | } 50 | 51 | QGpgMEReceiveKeysJob::~QGpgMEReceiveKeysJob() = default; 52 | 53 | static QGpgMEReceiveKeysJob::result_type importfromkeyserver(Context *ctx, const QStringList &keyIds) 54 | { 55 | const ImportResult res = ctx->importKeys(toStrings(keyIds)); 56 | Error ae; 57 | const QString log = _detail::audit_log_as_html(ctx, ae); 58 | return std::make_tuple(res, log, ae); 59 | } 60 | 61 | Error QGpgMEReceiveKeysJob::start(const QStringList &keyIds) 62 | { 63 | run(std::bind(&importfromkeyserver, std::placeholders::_1, keyIds)); 64 | return Error(); 65 | } 66 | 67 | GpgME::ImportResult QGpgME::QGpgMEReceiveKeysJob::exec(const QStringList &keyIds) 68 | { 69 | const result_type r = importfromkeyserver(context(), keyIds); 70 | return std::get<0>(r); 71 | } 72 | 73 | #include "moc_qgpgmereceivekeysjob.cpp" 74 | -------------------------------------------------------------------------------- /src/qgpgmeimportfromkeyserverjob.h: -------------------------------------------------------------------------------- 1 | /* 2 | qgpgmeimportfromkeyserverjob.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB 6 | Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik 7 | Software engineering by Intevation GmbH 8 | 9 | QGpgME is free software; you can redistribute it and/or 10 | modify it under the terms of the GNU General Public License as 11 | published by the Free Software Foundation; either version 2 of the 12 | License, or (at your option) any later version. 13 | 14 | QGpgME is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with this program; if not, write to the Free Software 21 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | 23 | In addition, as a special exception, the copyright holders give 24 | permission to link the code of this program with any edition of 25 | the Qt library by Trolltech AS, Norway (or with modified versions 26 | of Qt that use the same license as Qt), and distribute linked 27 | combinations including the two. You must obey the GNU General 28 | Public License in all respects for all of the code used other than 29 | Qt. If you modify this file, you may extend this exception to 30 | your version of the file, but you are not obligated to do so. If 31 | you do not wish to do so, delete this exception statement from 32 | your version. 33 | */ 34 | 35 | #ifndef __QGPGME_QGPGMEIMPORTFROMKEYSERVERJOB_H__ 36 | #define __QGPGME_QGPGMEIMPORTFROMKEYSERVERJOB_H__ 37 | 38 | #include "importfromkeyserverjob.h" 39 | 40 | #include "threadedjobmixin.h" 41 | 42 | #include 43 | 44 | namespace QGpgME 45 | { 46 | 47 | class QGpgMEImportFromKeyserverJob 48 | #ifdef Q_MOC_RUN 49 | : public ImportFromKeyserverJob 50 | #else 51 | : public _detail::ThreadedJobMixin > 52 | #endif 53 | { 54 | Q_OBJECT 55 | #ifdef Q_MOC_RUN 56 | public Q_SLOTS: 57 | void slotFinished(); 58 | #endif 59 | public: 60 | explicit QGpgMEImportFromKeyserverJob(GpgME::Context *context); 61 | ~QGpgMEImportFromKeyserverJob(); 62 | 63 | /* from ImportFromKeyserverJob */ 64 | GpgME::Error start(const std::vector &keys) override; 65 | 66 | /* from ImportFromKeyserverJob */ 67 | GpgME::ImportResult exec(const std::vector &keys) override; 68 | }; 69 | 70 | } 71 | 72 | #endif // __QGPGME_QGPGMEIMPORTFROMKEYSERVERJOB_H__ 73 | -------------------------------------------------------------------------------- /src/qgpgmedecryptverifyarchivejob.h: -------------------------------------------------------------------------------- 1 | /* 2 | qgpgmedecryptverifyarchivejob.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2023 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #ifndef __QGPGME_QGPGMEDECRYPTVERIFYARCHIVEJOB_H__ 35 | #define __QGPGME_QGPGMEDECRYPTVERIFYARCHIVEJOB_H__ 36 | 37 | #include "decryptverifyarchivejob.h" 38 | 39 | #include "threadedjobmixin.h" 40 | 41 | #include 42 | #include 43 | 44 | namespace QGpgME 45 | { 46 | 47 | class QGpgMEDecryptVerifyArchiveJobPrivate; 48 | 49 | class QGpgMEDecryptVerifyArchiveJob 50 | #ifdef Q_MOC_RUN 51 | : public DecryptVerifyArchiveJob 52 | #else 53 | : public _detail::ThreadedJobMixin> 54 | #endif 55 | { 56 | Q_OBJECT 57 | #ifdef Q_MOC_RUN 58 | public Q_SLOTS: 59 | void slotFinished(); 60 | #endif 61 | public: 62 | explicit QGpgMEDecryptVerifyArchiveJob(GpgME::Context *context); 63 | ~QGpgMEDecryptVerifyArchiveJob() = default; 64 | 65 | GpgME::Error start(const std::shared_ptr &cipherText) override; 66 | 67 | private: 68 | Q_DECLARE_PRIVATE(QGpgMEDecryptVerifyArchiveJob) 69 | }; 70 | 71 | } 72 | 73 | #endif // __QGPGME_QGPGMEDECRYPTVERIFYARCHIVEJOB_H__ 74 | -------------------------------------------------------------------------------- /src/qgpgmerefreshsmimekeysjob.h: -------------------------------------------------------------------------------- 1 | /* 2 | qgpgmerefreshsmimekeysjob.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2004 Klarälvdalens Datakonsult AB 6 | Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik 7 | Software engineering by Intevation GmbH 8 | 9 | QGpgME is free software; you can redistribute it and/or 10 | modify it under the terms of the GNU General Public License as 11 | published by the Free Software Foundation; either version 2 of the 12 | License, or (at your option) any later version. 13 | 14 | QGpgME is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with this program; if not, write to the Free Software 21 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | 23 | In addition, as a special exception, the copyright holders give 24 | permission to link the code of this program with any edition of 25 | the Qt library by Trolltech AS, Norway (or with modified versions 26 | of Qt that use the same license as Qt), and distribute linked 27 | combinations including the two. You must obey the GNU General 28 | Public License in all respects for all of the code used other than 29 | Qt. If you modify this file, you may extend this exception to 30 | your version of the file, but you are not obligated to do so. If 31 | you do not wish to do so, delete this exception statement from 32 | your version. 33 | */ 34 | 35 | #ifndef __QGPGME_QGPGMEREFRESHSMIMEKEYSJOB_H__ 36 | #define __QGPGME_QGPGMEREFRESHSMIMEKEYSJOB_H__ 37 | 38 | #include "refreshkeysjob.h" 39 | 40 | #include 41 | 42 | #include 43 | #include 44 | 45 | namespace QGpgME 46 | { 47 | 48 | class QGpgMERefreshSMIMEKeysJob : public RefreshKeysJob 49 | { 50 | Q_OBJECT 51 | public: 52 | QGpgMERefreshSMIMEKeysJob(); 53 | ~QGpgMERefreshSMIMEKeysJob(); 54 | 55 | /* from RefreshKeysJob */ 56 | GpgME::Error start(const QStringList &patterns) override; 57 | 58 | GpgME::Error start(const std::vector &keys) override; 59 | 60 | private Q_SLOTS: 61 | /* from Job */ 62 | void slotCancel() override; 63 | 64 | void slotStatus(QProcess *, const QString &, const QStringList &); 65 | void slotProcessExited(int exitCode, QProcess::ExitStatus exitStatus); 66 | 67 | private: 68 | GpgME::Error startAProcess(); 69 | 70 | private: 71 | QProcess *mProcess; 72 | GpgME::Error mError; 73 | QStringList mPatternsToDo; 74 | }; 75 | 76 | } 77 | 78 | #endif // __QGPGME_QGPGMEREFRESHSMIMEKEYSJOB_H__ 79 | -------------------------------------------------------------------------------- /src/qgpgmechangeexpiryjob.h: -------------------------------------------------------------------------------- 1 | /* 2 | qgpgmechangeexpiryjob.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2008 Klarälvdalens Datakonsult AB 6 | Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik 7 | Software engineering by Intevation GmbH 8 | 9 | QGpgME is free software; you can redistribute it and/or 10 | modify it under the terms of the GNU General Public License as 11 | published by the Free Software Foundation; either version 2 of the 12 | License, or (at your option) any later version. 13 | 14 | QGpgME is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with this program; if not, write to the Free Software 21 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | 23 | In addition, as a special exception, the copyright holders give 24 | permission to link the code of this program with any edition of 25 | the Qt library by Trolltech AS, Norway (or with modified versions 26 | of Qt that use the same license as Qt), and distribute linked 27 | combinations including the two. You must obey the GNU General 28 | Public License in all respects for all of the code used other than 29 | Qt. If you modify this file, you may extend this exception to 30 | your version of the file, but you are not obligated to do so. If 31 | you do not wish to do so, delete this exception statement from 32 | your version. 33 | */ 34 | 35 | #ifndef __QGPGME_QGPGMECHANGEEXPIRYJOB_H__ 36 | #define __QGPGME_QGPGMECHANGEEXPIRYJOB_H__ 37 | 38 | #include "changeexpiryjob.h" 39 | 40 | #include "threadedjobmixin.h" 41 | 42 | namespace QGpgME 43 | { 44 | 45 | class QGpgMEChangeExpiryJobPrivate; 46 | 47 | class QGpgMEChangeExpiryJob 48 | #ifdef Q_MOC_RUN 49 | : public ChangeExpiryJob 50 | #else 51 | : public _detail::ThreadedJobMixin 52 | #endif 53 | { 54 | Q_OBJECT 55 | #ifdef Q_MOC_RUN 56 | private Q_SLOTS: 57 | void slotFinished(); 58 | #endif 59 | public: 60 | explicit QGpgMEChangeExpiryJob(GpgME::Context *context); 61 | ~QGpgMEChangeExpiryJob(); 62 | 63 | /* from ChangeExpiryJob */ 64 | GpgME::Error start(const GpgME::Key &key, const QDateTime &expiry) override; 65 | 66 | /* from ChangeExpiryJob */ 67 | GpgME::Error start(const GpgME::Key &key, const QDateTime &expiry, 68 | const std::vector &subkeys) override; 69 | 70 | private: 71 | Q_DECLARE_PRIVATE(QGpgMEChangeExpiryJob) 72 | }; 73 | 74 | } 75 | 76 | #endif // __QGPGME_QGPGMECHANGEEXPIRYJOB_H__ 77 | -------------------------------------------------------------------------------- /src/qgpgmequickjob.h: -------------------------------------------------------------------------------- 1 | /* qgpgmequickjob.h 2 | 3 | This file is part of qgpgme, the Qt API binding for gpgme 4 | Copyright (c) 2017 Intevation GmbH 5 | Copyright (c) 2020 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License along 19 | with this program; if not, write to the Free Software Foundation, Inc., 20 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | #ifndef QGPGME_QGPGMEQUICKJOB_H 34 | #define QGPGME_QGPGMEQUICKJOB_H 35 | 36 | #include "quickjob.h" 37 | 38 | #include "threadedjobmixin.h" 39 | 40 | namespace QGpgME 41 | { 42 | 43 | class QGpgMEQuickJobPrivate; 44 | 45 | /** 46 | * Interface to the modern key manipulation functions. 47 | */ 48 | class QGpgMEQuickJob 49 | #ifdef Q_MOC_RUN 50 | : public QuickJob 51 | #else 52 | : public _detail::ThreadedJobMixin 53 | #endif 54 | { 55 | Q_OBJECT 56 | #ifdef Q_MOC_RUN 57 | public Q_SLOTS: 58 | void slotFinished(); 59 | #endif 60 | public: 61 | explicit QGpgMEQuickJob(GpgME::Context *context); 62 | ~QGpgMEQuickJob() override; 63 | 64 | void startAddUid(const GpgME::Key &key, const QString &uid) override; 65 | void startRevUid(const GpgME::Key &key, const QString &uid) override; 66 | void startRevokeSignature(const GpgME::Key &key, const GpgME::Key &signingKey, 67 | const std::vector &userIds = std::vector()) override; 68 | void startAddAdsk(const GpgME::Key &key, const char *adsk) override; 69 | 70 | private: 71 | Q_DECLARE_PRIVATE(QGpgMEQuickJob) 72 | }; 73 | 74 | } 75 | #endif 76 | -------------------------------------------------------------------------------- /src/qgpgmedecryptjob.h: -------------------------------------------------------------------------------- 1 | /* 2 | qgpgmedecryptjob.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB 6 | Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik 7 | Software engineering by Intevation GmbH 8 | 9 | QGpgME is free software; you can redistribute it and/or 10 | modify it under the terms of the GNU General Public License as 11 | published by the Free Software Foundation; either version 2 of the 12 | License, or (at your option) any later version. 13 | 14 | QGpgME is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with this program; if not, write to the Free Software 21 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | 23 | In addition, as a special exception, the copyright holders give 24 | permission to link the code of this program with any edition of 25 | the Qt library by Trolltech AS, Norway (or with modified versions 26 | of Qt that use the same license as Qt), and distribute linked 27 | combinations including the two. You must obey the GNU General 28 | Public License in all respects for all of the code used other than 29 | Qt. If you modify this file, you may extend this exception to 30 | your version of the file, but you are not obligated to do so. If 31 | you do not wish to do so, delete this exception statement from 32 | your version. 33 | */ 34 | 35 | #ifndef __QGPGME_QGPGMEDECRYPTJOB_H__ 36 | #define __QGPGME_QGPGMEDECRYPTJOB_H__ 37 | 38 | #include "decryptjob.h" 39 | 40 | #include "threadedjobmixin.h" 41 | 42 | #include 43 | 44 | namespace QGpgME 45 | { 46 | 47 | class QGpgMEDecryptJob 48 | #ifdef Q_MOC_RUN 49 | : public DecryptJob 50 | #else 51 | : public _detail::ThreadedJobMixin > 52 | #endif 53 | { 54 | Q_OBJECT 55 | #ifdef Q_MOC_RUN 56 | private Q_SLOTS: 57 | void slotFinished(); 58 | #endif 59 | public: 60 | explicit QGpgMEDecryptJob(GpgME::Context *context); 61 | ~QGpgMEDecryptJob(); 62 | 63 | /* from DecryptJob */ 64 | GpgME::Error start(const QByteArray &cipherText) override; 65 | 66 | /* from DecryptJob */ 67 | void start(const std::shared_ptr &cipherText, const std::shared_ptr &plainText) override; 68 | 69 | /* from DecryptJob */ 70 | GpgME::DecryptionResult exec(const QByteArray &cipherText, 71 | QByteArray &plainText) override; 72 | }; 73 | 74 | } 75 | #endif // __QGPGME_QGPGMEDECRYPTJOB_H__ 76 | -------------------------------------------------------------------------------- /src/qgpgmeencryptarchivejob.h: -------------------------------------------------------------------------------- 1 | /* 2 | qgpgmeencryptarchivejob.h 3 | 4 | This file is part of qgpgme, the Qt API binding for gpgme 5 | Copyright (c) 2023 g10 Code GmbH 6 | Software engineering by Ingo Klöcker 7 | 8 | QGpgME is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the 11 | License, or (at your option) any later version. 12 | 13 | QGpgME is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | 22 | In addition, as a special exception, the copyright holders give 23 | permission to link the code of this program with any edition of 24 | the Qt library by Trolltech AS, Norway (or with modified versions 25 | of Qt that use the same license as Qt), and distribute linked 26 | combinations including the two. You must obey the GNU General 27 | Public License in all respects for all of the code used other than 28 | Qt. If you modify this file, you may extend this exception to 29 | your version of the file, but you are not obligated to do so. If 30 | you do not wish to do so, delete this exception statement from 31 | your version. 32 | */ 33 | 34 | #ifndef __QGPGME_QGPGMEENCRYPTARCHIVEJOB_H__ 35 | #define __QGPGME_QGPGMEENCRYPTARCHIVEJOB_H__ 36 | 37 | #include "encryptarchivejob.h" 38 | 39 | #include "threadedjobmixin.h" 40 | 41 | #include 42 | 43 | namespace QGpgME 44 | { 45 | 46 | class QGpgMEEncryptArchiveJobPrivate; 47 | 48 | class QGpgMEEncryptArchiveJob 49 | #ifdef Q_MOC_RUN 50 | : public EncryptArchiveJob 51 | #else 52 | : public _detail::ThreadedJobMixin> 53 | #endif 54 | { 55 | Q_OBJECT 56 | #ifdef Q_MOC_RUN 57 | public Q_SLOTS: 58 | void slotFinished(); 59 | #endif 60 | public: 61 | explicit QGpgMEEncryptArchiveJob(GpgME::Context *context); 62 | ~QGpgMEEncryptArchiveJob() = default; 63 | 64 | GpgME::Error start(const std::vector &recipients, 65 | const std::vector &paths, 66 | const std::shared_ptr &cipherText, 67 | const GpgME::Context::EncryptionFlags flags) override; 68 | 69 | private: 70 | Q_DECLARE_PRIVATE(QGpgMEEncryptArchiveJob) 71 | }; 72 | 73 | } 74 | 75 | #endif // __QGPGME_QGPGMEENCRYPTARCHIVEJOB_H__ 76 | -------------------------------------------------------------------------------- /src/defaultkeygenerationjob.h: -------------------------------------------------------------------------------- 1 | /* defaultkeygenerationjob.h 2 | 3 | Copyright (c) 2016 Klarälvdalens Datakonsult AB 4 | 2016 Bundesamt für Sicherheit in der Informationstechnik 5 | Software engineering by Intevation GmbH 6 | 7 | QGpgME is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU General Public License as 9 | published by the Free Software Foundation; either version 2 of the 10 | License, or (at your option) any later version. 11 | 12 | QGpgME is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License along 18 | with this program; if not, write to the Free Software Foundation, Inc., 19 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | 21 | In addition, as a special exception, the copyright holders give 22 | permission to link the code of this program with any edition of 23 | the Qt library by Trolltech AS, Norway (or with modified versions 24 | of Qt that use the same license as Qt), and distribute linked 25 | combinations including the two. You must obey the GNU General 26 | Public License in all respects for all of the code used other than 27 | Qt. If you modify this file, you may extend this exception to 28 | your version of the file, but you are not obligated to do so. If 29 | you do not wish to do so, delete this exception statement from 30 | your version. 31 | */ 32 | #ifndef QGPGME_DEFAULTKEYGENERATION_H 33 | #define QGPGME_DEFAULTKEYGENERATION_H 34 | 35 | #include "job.h" 36 | 37 | #include "qgpgme_export.h" 38 | 39 | namespace GpgME { 40 | class KeyGenerationResult; 41 | } 42 | 43 | namespace QGpgME{ 44 | 45 | /** 46 | * Generates a PGP RSA/2048 bit key pair for given name and email address. 47 | * 48 | * This job is deprecated. Use QuickJob::startCreate instead. 49 | */ 50 | class QGPGME_DEPRECATED_EXPORT DefaultKeyGenerationJob : public Job 51 | { 52 | Q_OBJECT 53 | public: 54 | explicit DefaultKeyGenerationJob(QObject *parent = nullptr); 55 | ~DefaultKeyGenerationJob(); 56 | 57 | GpgME::Error start(const QString &email, const QString &name); 58 | 59 | QString auditLogAsHtml() const override; 60 | GpgME::Error auditLogError() const override; 61 | 62 | 63 | public Q_SLOTS: 64 | void slotCancel() override; 65 | 66 | Q_SIGNALS: 67 | void result(const GpgME::KeyGenerationResult &result, const QByteArray &pubkeyData, 68 | const QString &auditLogAsHtml, const GpgME::Error &auditLogError); 69 | 70 | protected: 71 | bool eventFilter(QObject *watched, QEvent *event) override; 72 | 73 | private: 74 | class Private; 75 | Private * const d; 76 | }; 77 | 78 | } 79 | 80 | #endif 81 | --------------------------------------------------------------------------------