\hypertarget{group__wickr__root__keys}{}\doxysection{Wickr\+\_\+root\+\_\+keys}
\label{group__wickr__root__keys}\index{Wickr\_root\_keys@{Wickr\_root\_keys}}
\doxysubsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \mbox{\hyperlink{structwickr__root__keys}{wickr\+\_\+root\+\_\+keys}}
\begin{DoxyCompactList}\small\item\em Root level crypto keys for signatures, local encryption, and remote encryption. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{structwickr__root__keys}{wickr\+\_\+root\+\_\+keys\+\_\+t}} $\ast$ \mbox{\hyperlink{group__wickr__root__keys_gab6289774ce4bcbdc08584695f9b7c34c}{wickr\+\_\+root\+\_\+keys\+\_\+create}} (\mbox{\hyperlink{structwickr__ec__key}{wickr\+\_\+ec\+\_\+key\+\_\+t}} $\ast$node\+\_\+signature\+\_\+root, \mbox{\hyperlink{structwickr__cipher__key}{wickr\+\_\+cipher\+\_\+key\+\_\+t}} $\ast$node\+\_\+storage\+\_\+root, \mbox{\hyperlink{structwickr__cipher__key}{wickr\+\_\+cipher\+\_\+key\+\_\+t}} $\ast$remote\+\_\+storage\+\_\+root)
\item 
\mbox{\hyperlink{structwickr__root__keys}{wickr\+\_\+root\+\_\+keys\+\_\+t}} $\ast$ \mbox{\hyperlink{group__wickr__root__keys_gac6d33868c25a85e5da5cff92a4eab189}{wickr\+\_\+root\+\_\+keys\+\_\+generate}} (const \mbox{\hyperlink{structwickr__crypto__engine}{wickr\+\_\+crypto\+\_\+engine\+\_\+t}} $\ast$engine)
\item 
\mbox{\hyperlink{structwickr__root__keys}{wickr\+\_\+root\+\_\+keys\+\_\+t}} $\ast$ \mbox{\hyperlink{group__wickr__root__keys_ga5ab25c65aa25fbe96d978f8e06376653}{wickr\+\_\+root\+\_\+keys\+\_\+create\+\_\+from\+\_\+buffer}} (const \mbox{\hyperlink{structwickr__crypto__engine}{wickr\+\_\+crypto\+\_\+engine\+\_\+t}} $\ast$engine, const \mbox{\hyperlink{structwickr__buffer}{wickr\+\_\+buffer\+\_\+t}} $\ast$buffer)
\item 
\mbox{\hyperlink{structwickr__buffer}{wickr\+\_\+buffer\+\_\+t}} $\ast$ \mbox{\hyperlink{group__wickr__root__keys_ga6875c9f677c4ec127276714976a623a5}{wickr\+\_\+root\+\_\+keys\+\_\+serialize}} (const \mbox{\hyperlink{structwickr__root__keys}{wickr\+\_\+root\+\_\+keys\+\_\+t}} $\ast$keys)
\item 
\mbox{\hyperlink{structwickr__cipher__result}{wickr\+\_\+cipher\+\_\+result\+\_\+t}} $\ast$ \mbox{\hyperlink{group__wickr__root__keys_ga6e3a04e7e1c65ada93450051eb4f4459}{wickr\+\_\+root\+\_\+keys\+\_\+export}} (const \mbox{\hyperlink{structwickr__root__keys}{wickr\+\_\+root\+\_\+keys\+\_\+t}} $\ast$keys, const \mbox{\hyperlink{structwickr__crypto__engine}{wickr\+\_\+crypto\+\_\+engine\+\_\+t}} $\ast$engine, const \mbox{\hyperlink{structwickr__cipher__key}{wickr\+\_\+cipher\+\_\+key\+\_\+t}} $\ast$export\+\_\+key)
\item 
\mbox{\hyperlink{structwickr__storage__keys}{wickr\+\_\+storage\+\_\+keys\+\_\+t}} $\ast$ \mbox{\hyperlink{group__wickr__root__keys_gaa34dd6c85c667b8b7fb025f56c7bcc46}{wickr\+\_\+root\+\_\+keys\+\_\+localize}} (const \mbox{\hyperlink{structwickr__root__keys}{wickr\+\_\+root\+\_\+keys\+\_\+t}} $\ast$keys, const \mbox{\hyperlink{structwickr__crypto__engine}{wickr\+\_\+crypto\+\_\+engine\+\_\+t}} $\ast$engine, const \mbox{\hyperlink{structwickr__dev__info}{wickr\+\_\+dev\+\_\+info\+\_\+t}} $\ast$dev\+\_\+info)
\item 
\mbox{\hyperlink{structwickr__root__keys}{wickr\+\_\+root\+\_\+keys\+\_\+t}} $\ast$ \mbox{\hyperlink{group__wickr__root__keys_gadda1b8fd1b5cc1cf6b7b2b0e72912858}{wickr\+\_\+root\+\_\+keys\+\_\+copy}} (const \mbox{\hyperlink{structwickr__root__keys}{wickr\+\_\+root\+\_\+keys\+\_\+t}} $\ast$source)
\item 
void \mbox{\hyperlink{group__wickr__root__keys_gacabc33b7c56cbc84a5085d0a4330694f}{wickr\+\_\+root\+\_\+keys\+\_\+destroy}} (\mbox{\hyperlink{structwickr__root__keys}{wickr\+\_\+root\+\_\+keys\+\_\+t}} $\ast$$\ast$keys)
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}


\doxysubsection{Function Documentation}
\mbox{\Hypertarget{group__wickr__root__keys_gadda1b8fd1b5cc1cf6b7b2b0e72912858}\label{group__wickr__root__keys_gadda1b8fd1b5cc1cf6b7b2b0e72912858}} 
\index{Wickr\_root\_keys@{Wickr\_root\_keys}!wickr\_root\_keys\_copy@{wickr\_root\_keys\_copy}}
\index{wickr\_root\_keys\_copy@{wickr\_root\_keys\_copy}!Wickr\_root\_keys@{Wickr\_root\_keys}}
\doxysubsubsection{\texorpdfstring{wickr\_root\_keys\_copy()}{wickr\_root\_keys\_copy()}}
{\footnotesize\ttfamily \mbox{\hyperlink{structwickr__root__keys}{wickr\+\_\+root\+\_\+keys\+\_\+t}}$\ast$ wickr\+\_\+root\+\_\+keys\+\_\+copy (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{structwickr__root__keys}{wickr\+\_\+root\+\_\+keys\+\_\+t}} $\ast$}]{source }\end{DoxyParamCaption})}

Copy a root key set


\begin{DoxyParams}{Parameters}
{\em source} & the root key set to copy \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a newly allocated root key set holding a deep copy of the properties of \textquotesingle{}source\textquotesingle{} 
\end{DoxyReturn}
\mbox{\Hypertarget{group__wickr__root__keys_gab6289774ce4bcbdc08584695f9b7c34c}\label{group__wickr__root__keys_gab6289774ce4bcbdc08584695f9b7c34c}} 
\index{Wickr\_root\_keys@{Wickr\_root\_keys}!wickr\_root\_keys\_create@{wickr\_root\_keys\_create}}
\index{wickr\_root\_keys\_create@{wickr\_root\_keys\_create}!Wickr\_root\_keys@{Wickr\_root\_keys}}
\doxysubsubsection{\texorpdfstring{wickr\_root\_keys\_create()}{wickr\_root\_keys\_create()}}
{\footnotesize\ttfamily \mbox{\hyperlink{structwickr__root__keys}{wickr\+\_\+root\+\_\+keys\+\_\+t}}$\ast$ wickr\+\_\+root\+\_\+keys\+\_\+create (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{structwickr__ec__key}{wickr\+\_\+ec\+\_\+key\+\_\+t}} $\ast$}]{node\+\_\+signature\+\_\+root,  }\item[{\mbox{\hyperlink{structwickr__cipher__key}{wickr\+\_\+cipher\+\_\+key\+\_\+t}} $\ast$}]{node\+\_\+storage\+\_\+root,  }\item[{\mbox{\hyperlink{structwickr__cipher__key}{wickr\+\_\+cipher\+\_\+key\+\_\+t}} $\ast$}]{remote\+\_\+storage\+\_\+root }\end{DoxyParamCaption})}

Create a root key set from components


\begin{DoxyParams}{Parameters}
{\em node\+\_\+signature\+\_\+root} & see \textquotesingle{}\mbox{\hyperlink{structwickr__root__keys}{wickr\+\_\+root\+\_\+keys}}\textquotesingle{} property documentation \\
\hline
{\em node\+\_\+storage\+\_\+root} & see \textquotesingle{}\mbox{\hyperlink{structwickr__root__keys}{wickr\+\_\+root\+\_\+keys}}\textquotesingle{} property documentation \\
\hline
{\em remote\+\_\+storage\+\_\+root} & see \textquotesingle{}\mbox{\hyperlink{structwickr__root__keys}{wickr\+\_\+root\+\_\+keys}}\textquotesingle{} property documentation \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a newly allocated root key set. Takes ownership of the passed inputs 
\end{DoxyReturn}
\mbox{\Hypertarget{group__wickr__root__keys_ga5ab25c65aa25fbe96d978f8e06376653}\label{group__wickr__root__keys_ga5ab25c65aa25fbe96d978f8e06376653}} 
\index{Wickr\_root\_keys@{Wickr\_root\_keys}!wickr\_root\_keys\_create\_from\_buffer@{wickr\_root\_keys\_create\_from\_buffer}}
\index{wickr\_root\_keys\_create\_from\_buffer@{wickr\_root\_keys\_create\_from\_buffer}!Wickr\_root\_keys@{Wickr\_root\_keys}}
\doxysubsubsection{\texorpdfstring{wickr\_root\_keys\_create\_from\_buffer()}{wickr\_root\_keys\_create\_from\_buffer()}}
{\footnotesize\ttfamily \mbox{\hyperlink{structwickr__root__keys}{wickr\+\_\+root\+\_\+keys\+\_\+t}}$\ast$ wickr\+\_\+root\+\_\+keys\+\_\+create\+\_\+from\+\_\+buffer (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{structwickr__crypto__engine}{wickr\+\_\+crypto\+\_\+engine\+\_\+t}} $\ast$}]{engine,  }\item[{const \mbox{\hyperlink{structwickr__buffer}{wickr\+\_\+buffer\+\_\+t}} $\ast$}]{buffer }\end{DoxyParamCaption})}

Create a root key set from the serialized output of \textquotesingle{}wickr\+\_\+root\+\_\+keys\+\_\+serialize\textquotesingle{}


\begin{DoxyParams}{Parameters}
{\em engine} & a crypto engine to validate the decoded EC keys \\
\hline
{\em buffer} & a buffer containing serialized root keys \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a root key set parsed out of buffer, or NULL if parsing fails 
\end{DoxyReturn}
\mbox{\Hypertarget{group__wickr__root__keys_gacabc33b7c56cbc84a5085d0a4330694f}\label{group__wickr__root__keys_gacabc33b7c56cbc84a5085d0a4330694f}} 
\index{Wickr\_root\_keys@{Wickr\_root\_keys}!wickr\_root\_keys\_destroy@{wickr\_root\_keys\_destroy}}
\index{wickr\_root\_keys\_destroy@{wickr\_root\_keys\_destroy}!Wickr\_root\_keys@{Wickr\_root\_keys}}
\doxysubsubsection{\texorpdfstring{wickr\_root\_keys\_destroy()}{wickr\_root\_keys\_destroy()}}
{\footnotesize\ttfamily void wickr\+\_\+root\+\_\+keys\+\_\+destroy (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{structwickr__root__keys}{wickr\+\_\+root\+\_\+keys\+\_\+t}} $\ast$$\ast$}]{keys }\end{DoxyParamCaption})}

Destroy a root key set


\begin{DoxyParams}{Parameters}
{\em keys} & a pointer to a root key set to destroy. Will destroy the sub properties of \textquotesingle{}$\ast$keys\textquotesingle{} as well \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{group__wickr__root__keys_ga6e3a04e7e1c65ada93450051eb4f4459}\label{group__wickr__root__keys_ga6e3a04e7e1c65ada93450051eb4f4459}} 
\index{Wickr\_root\_keys@{Wickr\_root\_keys}!wickr\_root\_keys\_export@{wickr\_root\_keys\_export}}
\index{wickr\_root\_keys\_export@{wickr\_root\_keys\_export}!Wickr\_root\_keys@{Wickr\_root\_keys}}
\doxysubsubsection{\texorpdfstring{wickr\_root\_keys\_export()}{wickr\_root\_keys\_export()}}
{\footnotesize\ttfamily \mbox{\hyperlink{structwickr__cipher__result}{wickr\+\_\+cipher\+\_\+result\+\_\+t}}$\ast$ wickr\+\_\+root\+\_\+keys\+\_\+export (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{structwickr__root__keys}{wickr\+\_\+root\+\_\+keys\+\_\+t}} $\ast$}]{keys,  }\item[{const \mbox{\hyperlink{structwickr__crypto__engine}{wickr\+\_\+crypto\+\_\+engine\+\_\+t}} $\ast$}]{engine,  }\item[{const \mbox{\hyperlink{structwickr__cipher__key}{wickr\+\_\+cipher\+\_\+key\+\_\+t}} $\ast$}]{export\+\_\+key }\end{DoxyParamCaption})}

Serialize and encrypt root keys


\begin{DoxyParams}{Parameters}
{\em keys} & the keys to serialize and encrypt \\
\hline
{\em engine} & a crypto engine capable of encrypting data using \textquotesingle{}export\+\_\+key\textquotesingle{} \\
\hline
{\em export\+\_\+key} & the key to use for encryption of the serialized keys \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a cipher result of serialized \textquotesingle{}keys\textquotesingle{} encrypted with \textquotesingle{}export\+\_\+key\textquotesingle{} 
\end{DoxyReturn}
\mbox{\Hypertarget{group__wickr__root__keys_gac6d33868c25a85e5da5cff92a4eab189}\label{group__wickr__root__keys_gac6d33868c25a85e5da5cff92a4eab189}} 
\index{Wickr\_root\_keys@{Wickr\_root\_keys}!wickr\_root\_keys\_generate@{wickr\_root\_keys\_generate}}
\index{wickr\_root\_keys\_generate@{wickr\_root\_keys\_generate}!Wickr\_root\_keys@{Wickr\_root\_keys}}
\doxysubsubsection{\texorpdfstring{wickr\_root\_keys\_generate()}{wickr\_root\_keys\_generate()}}
{\footnotesize\ttfamily \mbox{\hyperlink{structwickr__root__keys}{wickr\+\_\+root\+\_\+keys\+\_\+t}}$\ast$ wickr\+\_\+root\+\_\+keys\+\_\+generate (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{structwickr__crypto__engine}{wickr\+\_\+crypto\+\_\+engine\+\_\+t}} $\ast$}]{engine }\end{DoxyParamCaption})}

Generate a random set of root keys


\begin{DoxyParams}{Parameters}
{\em engine} & a crypto engine supporting random EC and cipher key generation \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a random set of root keys 
\end{DoxyReturn}
\mbox{\Hypertarget{group__wickr__root__keys_gaa34dd6c85c667b8b7fb025f56c7bcc46}\label{group__wickr__root__keys_gaa34dd6c85c667b8b7fb025f56c7bcc46}} 
\index{Wickr\_root\_keys@{Wickr\_root\_keys}!wickr\_root\_keys\_localize@{wickr\_root\_keys\_localize}}
\index{wickr\_root\_keys\_localize@{wickr\_root\_keys\_localize}!Wickr\_root\_keys@{Wickr\_root\_keys}}
\doxysubsubsection{\texorpdfstring{wickr\_root\_keys\_localize()}{wickr\_root\_keys\_localize()}}
{\footnotesize\ttfamily \mbox{\hyperlink{structwickr__storage__keys}{wickr\+\_\+storage\+\_\+keys\+\_\+t}}$\ast$ wickr\+\_\+root\+\_\+keys\+\_\+localize (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{structwickr__root__keys}{wickr\+\_\+root\+\_\+keys\+\_\+t}} $\ast$}]{keys,  }\item[{const \mbox{\hyperlink{structwickr__crypto__engine}{wickr\+\_\+crypto\+\_\+engine\+\_\+t}} $\ast$}]{engine,  }\item[{const \mbox{\hyperlink{structwickr__dev__info}{wickr\+\_\+dev\+\_\+info\+\_\+t}} $\ast$}]{dev\+\_\+info }\end{DoxyParamCaption})}

Convert a root key set into a storage key set for a local device

Currently the local storage key is created by taking SHA256(keys-\/$>$node\+\_\+storage\+\_\+root $\vert$$\vert$ dev\+\_\+info-\/$>$system\+\_\+salt)


\begin{DoxyParams}{Parameters}
{\em keys} & the keys to convert \\
\hline
{\em engine} & a crypto engine to use for conversion \\
\hline
{\em dev\+\_\+info} & the device to localize the keys to \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a set of storage keys bound to \textquotesingle{}dev\+\_\+info\textquotesingle{} 
\end{DoxyReturn}
\mbox{\Hypertarget{group__wickr__root__keys_ga6875c9f677c4ec127276714976a623a5}\label{group__wickr__root__keys_ga6875c9f677c4ec127276714976a623a5}} 
\index{Wickr\_root\_keys@{Wickr\_root\_keys}!wickr\_root\_keys\_serialize@{wickr\_root\_keys\_serialize}}
\index{wickr\_root\_keys\_serialize@{wickr\_root\_keys\_serialize}!Wickr\_root\_keys@{Wickr\_root\_keys}}
\doxysubsubsection{\texorpdfstring{wickr\_root\_keys\_serialize()}{wickr\_root\_keys\_serialize()}}
{\footnotesize\ttfamily \mbox{\hyperlink{structwickr__buffer}{wickr\+\_\+buffer\+\_\+t}}$\ast$ wickr\+\_\+root\+\_\+keys\+\_\+serialize (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{structwickr__root__keys}{wickr\+\_\+root\+\_\+keys\+\_\+t}} $\ast$}]{keys }\end{DoxyParamCaption})}

Serialize root keys into a buffer


\begin{DoxyParams}{Parameters}
{\em keys} & the keys to serialize \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a buffer containing serialized root keys as a protocol buffer object 
\end{DoxyReturn}
