
\begin{DoxyItemize}
\item infos = Information about gpgme plugin is in keys below
\item infos/author = Peter Nirschl \href{mailto:peter.nirschl@gmail.com}{\tt peter.\+nirschl@gmail.\+com}
\item infos/licence = B\+SD
\item infos/provides = crypto
\item infos/needs =
\item infos/recommends =
\item infos/placements = postgetstorage presetstorage
\item infos/status = unittest configurable memleak experimental unfinished
\item infos/metadata = crypto/encrypt gpg/binary
\item infos/description = Cryptographic operations wit Gnu\+PG Made Easy (G\+P\+G\+ME)
\end{DoxyItemize}

The {\ttfamily gpgme} plugin is a filter plugin that enables users to encrypt values before they are persisted and to decrypt values after they have been read from a backend. The encryption and decryption is designed to work transparently.

The cryptographic operations are performed by Gnu\+PG via the {\ttfamily libgpgme} library.

\subsection*{Dependencies}


\begin{DoxyItemize}
\item {\ttfamily libgpgme11} version 1.\+10 or later
\end{DoxyItemize}

\subsection*{Build Information}

The plugin has been tested on Ubuntu 18.\+04 with {\ttfamily libgpgme} version 1.\+10.

\subsection*{Examples}

You can mount the plugin like this\+: \begin{DoxyVerb}kdb mount test.ecf /t gpgme "encrypt/key=DDEBEF9EE2DC931701338212DAF635B17F230E8D"
\end{DoxyVerb}


Now you can specify a key {\ttfamily user/t/a} and protect its content by using\+: \begin{DoxyVerb}kdb set user/t/a
kdb setmeta user/t/a crypt/encrypt 1
kdb set user/t/a "secret"
\end{DoxyVerb}


The value of {\ttfamily user/t/a} (for this example\+: \char`\"{}secret\char`\"{}) will be stored encrypted. You can still access the original value by using {\ttfamily kdb get}\+: \begin{DoxyVerb}kdb get user/t/a
\end{DoxyVerb}


\subsection*{Configuration}

\subsubsection*{Gnu\+PG Keys}

The G\+PG recipient keys can be specified in two ways\+:


\begin{DoxyEnumerate}
\item The G\+PG recipient key can be specified as {\ttfamily encrypt/key} directly.
\item If you want to specify multiple keys, you can enumerate them under {\ttfamily encrypt/key}.
\end{DoxyEnumerate}

The following example illustrates how multiple G\+PG recipient keys can be specified\+: \begin{DoxyVerb}encrypt/key/#0
encrypt/key/#1
\end{DoxyVerb}


\subsubsection*{Textmode}

{\ttfamily gpgme} operates in textmode per default. In textmode the output of G\+PG is A\+S\+C\+II armored.

Textmode can be disabled by setting {\ttfamily /gpgme/textmode} to {\ttfamily 0} in the plugin configuration.

\subsection*{Technical Details}

\subsubsection*{Message Format}

The encrypted values are valid P\+GP messages, that can be decrypted and read solely by the Gnu\+PG binary without Elektra. 