\hypertarget{KeyPackageOperator_8h_source}{}\doxysection{Key\+Package\+Operator.\+h} \label{KeyPackageOperator_8h_source}\index{src/core/function/KeyPackageOperator.h@{src/core/function/KeyPackageOperator.h}} \begin{DoxyCode}{0} \DoxyCodeLine{1 } \DoxyCodeLine{29 \textcolor{preprocessor}{\#ifndef GPGFRONTEND\_KEYPACKAGEOPERATOR\_H}} \DoxyCodeLine{30 \textcolor{preprocessor}{\#define GPGFRONTEND\_KEYPACKAGEOPERATOR\_H}} \DoxyCodeLine{31 } \DoxyCodeLine{32 \textcolor{preprocessor}{\#include "{}core/GpgFrontendCore.h"{}}} \DoxyCodeLine{33 \textcolor{preprocessor}{\#include "{}core/function/gpg/GpgKeyImportExporter.h"{}}} \DoxyCodeLine{34 } \DoxyCodeLine{35 \textcolor{keyword}{namespace }\mbox{\hyperlink{namespaceGpgFrontend}{GpgFrontend}} \{} \DoxyCodeLine{36 } \DoxyCodeLine{41 \textcolor{keyword}{class }GPGFRONTEND\_CORE\_EXPORT \mbox{\hyperlink{classGpgFrontend_1_1KeyPackageOperator}{KeyPackageOperator}} \{} \DoxyCodeLine{42 \textcolor{keyword}{public}:} \DoxyCodeLine{51 \textcolor{keyword}{static} \textcolor{keywordtype}{bool} GeneratePassphrase(\textcolor{keyword}{const} std::filesystem::path \&phrase\_path,} \DoxyCodeLine{52 std::string \&phrase);} \DoxyCodeLine{53 } \DoxyCodeLine{59 \textcolor{keyword}{static} std::string GenerateKeyPackageName();} \DoxyCodeLine{60 } \DoxyCodeLine{72 \textcolor{keyword}{static} \textcolor{keywordtype}{bool} GenerateKeyPackage(\textcolor{keyword}{const} std::filesystem::path \&key\_package\_path,} \DoxyCodeLine{73 \textcolor{keyword}{const} std::string \&key\_package\_name,} \DoxyCodeLine{74 KeyIdArgsListPtr \&key\_ids, std::string \&phrase,} \DoxyCodeLine{75 \textcolor{keywordtype}{bool} secret);} \DoxyCodeLine{76 } \DoxyCodeLine{86 \textcolor{keyword}{static} \textcolor{keywordtype}{bool} ImportKeyPackage(\textcolor{keyword}{const} std::filesystem::path \&key\_package\_path,} \DoxyCodeLine{87 \textcolor{keyword}{const} std::filesystem::path \&phrase\_path,} \DoxyCodeLine{88 \mbox{\hyperlink{classGpgFrontend_1_1GpgImportInformation}{GpgFrontend::GpgImportInformation}} \&import\_info);} \DoxyCodeLine{89 } \DoxyCodeLine{90 \textcolor{keyword}{private}:} \DoxyCodeLine{96 \textcolor{keyword}{static} std::string \mbox{\hyperlink{classGpgFrontend_1_1KeyPackageOperator_a825d987dacd8a99d9d87729e1861a152}{generate\_key\_package\_name}}() \{} \DoxyCodeLine{97 std::random\_device rd\_; } \DoxyCodeLine{98 \textcolor{keyword}{auto} mt\_ = std::mt19937(rd\_()); } \DoxyCodeLine{99 } \DoxyCodeLine{100 std::uniform\_int\_distribution dist(999, 99999);} \DoxyCodeLine{101 \textcolor{keyword}{auto} file\_string = boost::format(\textcolor{stringliteral}{"{}KeyPackage\_\%1\%"{}}) \% dist(mt\_);} \DoxyCodeLine{102 \textcolor{keywordflow}{return} file\_string.str();} \DoxyCodeLine{103 \}} \DoxyCodeLine{104 \};} \DoxyCodeLine{105 \} \textcolor{comment}{// namespace GpgFrontend}} \DoxyCodeLine{106 } \DoxyCodeLine{107 \textcolor{preprocessor}{\#endif }\textcolor{comment}{// GPGFRONTEND\_KEYPACKAGEOPERATOR\_H}} \end{DoxyCode}