aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/utils')
-rw-r--r--src/core/utils/GpgUtils.cpp9
-rw-r--r--src/core/utils/GpgUtils.h9
2 files changed, 18 insertions, 0 deletions
diff --git a/src/core/utils/GpgUtils.cpp b/src/core/utils/GpgUtils.cpp
index bfbee963..ec0f35e2 100644
--- a/src/core/utils/GpgUtils.cpp
+++ b/src/core/utils/GpgUtils.cpp
@@ -29,6 +29,7 @@
#include "GpgUtils.h"
#include "core/function/GlobalSettingStation.h"
+#include "core/model/GpgKey.h"
#include "core/model/KeyDatabaseInfo.h"
#include "core/model/SettingsObject.h"
#include "core/module/ModuleManager.h"
@@ -324,4 +325,12 @@ auto GetKeyDatabaseInfoBySettings() -> QList<KeyDatabaseInfo> {
return key_db_infos;
}
+
+auto GPGFRONTEND_CORE_EXPORT Convert2RawGpgMEKeyList(
+ const QContainer<GpgKey>& keys) -> QContainer<gpgme_key_t> {
+ QContainer<gpgme_key_t> recipients(keys.begin(), keys.end());
+ recipients.emplace_back(nullptr);
+
+ return recipients;
+}
} // namespace GpgFrontend
diff --git a/src/core/utils/GpgUtils.h b/src/core/utils/GpgUtils.h
index ab0c328f..89f3720a 100644
--- a/src/core/utils/GpgUtils.h
+++ b/src/core/utils/GpgUtils.h
@@ -147,4 +147,13 @@ auto GPGFRONTEND_CORE_EXPORT GetGpgKeyDatabaseInfos() -> QList<KeyDatabaseInfo>;
*/
auto GPGFRONTEND_CORE_EXPORT GetGpgKeyDatabaseName(int channel) -> QString;
+/**
+ * @brief
+ *
+ * @param keys
+ * @return QContainer<gpgme_key_t>
+ */
+auto GPGFRONTEND_CORE_EXPORT Convert2RawGpgMEKeyList(
+ const QContainer<GpgKey>& keys) -> QContainer<gpgme_key_t>;
+
} // namespace GpgFrontend \ No newline at end of file