\hypertarget{group__wickr__payload}{}\doxysection{wickr\+\_\+payload}
\label{group__wickr__payload}\index{wickr\_payload@{wickr\_payload}}
\doxysubsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \mbox{\hyperlink{structwickr__payload}{wickr\+\_\+payload}}
\begin{DoxyCompactList}\small\item\em The encrypted body content of a Wickr packet. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{structwickr__payload}{wickr\+\_\+payload\+\_\+t}} $\ast$ \mbox{\hyperlink{group__wickr__payload_gad7d51d39a8477d87557536ff42399186}{wickr\+\_\+payload\+\_\+create}} (\mbox{\hyperlink{structwickr__packet__meta}{wickr\+\_\+packet\+\_\+meta\+\_\+t}} $\ast$meta, \mbox{\hyperlink{structwickr__buffer}{wickr\+\_\+buffer\+\_\+t}} $\ast$body)
\item 
\mbox{\hyperlink{structwickr__payload}{wickr\+\_\+payload\+\_\+t}} $\ast$ \mbox{\hyperlink{group__wickr__payload_ga96e1b0eabf307d112985946cbe2f6969}{wickr\+\_\+payload\+\_\+copy}} (const \mbox{\hyperlink{structwickr__payload}{wickr\+\_\+payload\+\_\+t}} $\ast$source)
\item 
void \mbox{\hyperlink{group__wickr__payload_ga821c48aa748408e47ba2149e1628a487}{wickr\+\_\+payload\+\_\+destroy}} (\mbox{\hyperlink{structwickr__payload}{wickr\+\_\+payload\+\_\+t}} $\ast$$\ast$payload)
\item 
\mbox{\hyperlink{structwickr__buffer}{wickr\+\_\+buffer\+\_\+t}} $\ast$ \mbox{\hyperlink{group__wickr__payload_ga047613f464b15c627602399cd0c70c48}{wickr\+\_\+payload\+\_\+serialize}} (const \mbox{\hyperlink{structwickr__payload}{wickr\+\_\+payload\+\_\+t}} $\ast$payload)
\item 
\mbox{\hyperlink{structwickr__payload}{wickr\+\_\+payload\+\_\+t}} $\ast$ \mbox{\hyperlink{group__wickr__payload_ga0965051bd564c60fa3f890185e271a2d}{wickr\+\_\+payload\+\_\+create\+\_\+from\+\_\+buffer}} (const \mbox{\hyperlink{structwickr__buffer}{wickr\+\_\+buffer\+\_\+t}} $\ast$buffer)
\item 
\mbox{\hyperlink{structwickr__cipher__result}{wickr\+\_\+cipher\+\_\+result\+\_\+t}} $\ast$ \mbox{\hyperlink{group__wickr__payload_ga7e4fd2ad4de22c2f7d6160400d2e15e7}{wickr\+\_\+payload\+\_\+encrypt}} (const \mbox{\hyperlink{structwickr__payload}{wickr\+\_\+payload\+\_\+t}} $\ast$payload, const \mbox{\hyperlink{structwickr__crypto__engine}{wickr\+\_\+crypto\+\_\+engine\+\_\+t}} $\ast$engine, const \mbox{\hyperlink{structwickr__cipher__key}{wickr\+\_\+cipher\+\_\+key\+\_\+t}} $\ast$payload\+\_\+key)
\item 
\mbox{\hyperlink{structwickr__payload}{wickr\+\_\+payload\+\_\+t}} $\ast$ \mbox{\hyperlink{group__wickr__payload_gaeeebf95ba580b92254a91009245028ee}{wickr\+\_\+payload\+\_\+create\+\_\+from\+\_\+cipher}} (const \mbox{\hyperlink{structwickr__crypto__engine}{wickr\+\_\+crypto\+\_\+engine\+\_\+t}} $\ast$engine, const \mbox{\hyperlink{structwickr__cipher__result}{wickr\+\_\+cipher\+\_\+result\+\_\+t}} $\ast$cipher\+\_\+result, const \mbox{\hyperlink{structwickr__cipher__key}{wickr\+\_\+cipher\+\_\+key\+\_\+t}} $\ast$payload\+\_\+key)
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}


\doxysubsection{Function Documentation}
\mbox{\Hypertarget{group__wickr__payload_ga96e1b0eabf307d112985946cbe2f6969}\label{group__wickr__payload_ga96e1b0eabf307d112985946cbe2f6969}} 
\index{wickr\_payload@{wickr\_payload}!wickr\_payload\_copy@{wickr\_payload\_copy}}
\index{wickr\_payload\_copy@{wickr\_payload\_copy}!wickr\_payload@{wickr\_payload}}
\doxysubsubsection{\texorpdfstring{wickr\_payload\_copy()}{wickr\_payload\_copy()}}
{\footnotesize\ttfamily \mbox{\hyperlink{structwickr__payload}{wickr\+\_\+payload\+\_\+t}}$\ast$ wickr\+\_\+payload\+\_\+copy (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{structwickr__payload}{wickr\+\_\+payload\+\_\+t}} $\ast$}]{source }\end{DoxyParamCaption})}

Copy a payload


\begin{DoxyParams}{Parameters}
{\em source} & the payload to copy \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a newly allocated payload holding a deep copy of the properties of \textquotesingle{}source\textquotesingle{} 
\end{DoxyReturn}
\mbox{\Hypertarget{group__wickr__payload_gad7d51d39a8477d87557536ff42399186}\label{group__wickr__payload_gad7d51d39a8477d87557536ff42399186}} 
\index{wickr\_payload@{wickr\_payload}!wickr\_payload\_create@{wickr\_payload\_create}}
\index{wickr\_payload\_create@{wickr\_payload\_create}!wickr\_payload@{wickr\_payload}}
\doxysubsubsection{\texorpdfstring{wickr\_payload\_create()}{wickr\_payload\_create()}}
{\footnotesize\ttfamily \mbox{\hyperlink{structwickr__payload}{wickr\+\_\+payload\+\_\+t}}$\ast$ wickr\+\_\+payload\+\_\+create (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{structwickr__packet__meta}{wickr\+\_\+packet\+\_\+meta\+\_\+t}} $\ast$}]{meta,  }\item[{\mbox{\hyperlink{structwickr__buffer}{wickr\+\_\+buffer\+\_\+t}} $\ast$}]{body }\end{DoxyParamCaption})}

Create a payload from components


\begin{DoxyParams}{Parameters}
{\em meta} & see \textquotesingle{}\mbox{\hyperlink{structwickr__payload}{wickr\+\_\+payload}}\textquotesingle{} property documentation property documentation \\
\hline
{\em body} & see \textquotesingle{}\mbox{\hyperlink{structwickr__payload}{wickr\+\_\+payload}}\textquotesingle{} property documentation property documentation \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a newly allocated payload owning the properties passed in 
\end{DoxyReturn}
\mbox{\Hypertarget{group__wickr__payload_ga0965051bd564c60fa3f890185e271a2d}\label{group__wickr__payload_ga0965051bd564c60fa3f890185e271a2d}} 
\index{wickr\_payload@{wickr\_payload}!wickr\_payload\_create\_from\_buffer@{wickr\_payload\_create\_from\_buffer}}
\index{wickr\_payload\_create\_from\_buffer@{wickr\_payload\_create\_from\_buffer}!wickr\_payload@{wickr\_payload}}
\doxysubsubsection{\texorpdfstring{wickr\_payload\_create\_from\_buffer()}{wickr\_payload\_create\_from\_buffer()}}
{\footnotesize\ttfamily \mbox{\hyperlink{structwickr__payload}{wickr\+\_\+payload\+\_\+t}}$\ast$ wickr\+\_\+payload\+\_\+create\+\_\+from\+\_\+buffer (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{structwickr__buffer}{wickr\+\_\+buffer\+\_\+t}} $\ast$}]{buffer }\end{DoxyParamCaption})}

Deserialize a buffer into a payload


\begin{DoxyParams}{Parameters}
{\em buffer} & a buffer containing a payload serialized with \textquotesingle{}wickr\+\_\+payload\+\_\+serialize\textquotesingle{} \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a payload with data contained in \textquotesingle{}buffer\textquotesingle{}, or NULL if \textquotesingle{}buffer\textquotesingle{} is not formatted properly 
\end{DoxyReturn}
\mbox{\Hypertarget{group__wickr__payload_gaeeebf95ba580b92254a91009245028ee}\label{group__wickr__payload_gaeeebf95ba580b92254a91009245028ee}} 
\index{wickr\_payload@{wickr\_payload}!wickr\_payload\_create\_from\_cipher@{wickr\_payload\_create\_from\_cipher}}
\index{wickr\_payload\_create\_from\_cipher@{wickr\_payload\_create\_from\_cipher}!wickr\_payload@{wickr\_payload}}
\doxysubsubsection{\texorpdfstring{wickr\_payload\_create\_from\_cipher()}{wickr\_payload\_create\_from\_cipher()}}
{\footnotesize\ttfamily \mbox{\hyperlink{structwickr__payload}{wickr\+\_\+payload\+\_\+t}}$\ast$ wickr\+\_\+payload\+\_\+create\+\_\+from\+\_\+cipher (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{structwickr__crypto__engine}{wickr\+\_\+crypto\+\_\+engine\+\_\+t}} $\ast$}]{engine,  }\item[{const \mbox{\hyperlink{structwickr__cipher__result}{wickr\+\_\+cipher\+\_\+result\+\_\+t}} $\ast$}]{cipher\+\_\+result,  }\item[{const \mbox{\hyperlink{structwickr__cipher__key}{wickr\+\_\+cipher\+\_\+key\+\_\+t}} $\ast$}]{payload\+\_\+key }\end{DoxyParamCaption})}

Decrypt-\/\+Then-\/\+Deserialize


\begin{DoxyParams}{Parameters}
{\em engine} & a crypto engine capable of decryption using payload\+\_\+key \\
\hline
{\em cipher\+\_\+result} & an encrypted payload \\
\hline
{\em payload\+\_\+key} & the key to use for decrypting \textquotesingle{}cipher\+\_\+result\textquotesingle{} \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a payload or NULL if an incorrect key is provided 
\end{DoxyReturn}
\mbox{\Hypertarget{group__wickr__payload_ga821c48aa748408e47ba2149e1628a487}\label{group__wickr__payload_ga821c48aa748408e47ba2149e1628a487}} 
\index{wickr\_payload@{wickr\_payload}!wickr\_payload\_destroy@{wickr\_payload\_destroy}}
\index{wickr\_payload\_destroy@{wickr\_payload\_destroy}!wickr\_payload@{wickr\_payload}}
\doxysubsubsection{\texorpdfstring{wickr\_payload\_destroy()}{wickr\_payload\_destroy()}}
{\footnotesize\ttfamily void wickr\+\_\+payload\+\_\+destroy (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{structwickr__payload}{wickr\+\_\+payload\+\_\+t}} $\ast$$\ast$}]{payload }\end{DoxyParamCaption})}

Destroy a payload


\begin{DoxyParams}{Parameters}
{\em payload} & a pointer to the payload to destroy. All properties of \textquotesingle{}$\ast$payload\textquotesingle{} will also be destroyed \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{group__wickr__payload_ga7e4fd2ad4de22c2f7d6160400d2e15e7}\label{group__wickr__payload_ga7e4fd2ad4de22c2f7d6160400d2e15e7}} 
\index{wickr\_payload@{wickr\_payload}!wickr\_payload\_encrypt@{wickr\_payload\_encrypt}}
\index{wickr\_payload\_encrypt@{wickr\_payload\_encrypt}!wickr\_payload@{wickr\_payload}}
\doxysubsubsection{\texorpdfstring{wickr\_payload\_encrypt()}{wickr\_payload\_encrypt()}}
{\footnotesize\ttfamily \mbox{\hyperlink{structwickr__cipher__result}{wickr\+\_\+cipher\+\_\+result\+\_\+t}}$\ast$ wickr\+\_\+payload\+\_\+encrypt (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{structwickr__payload}{wickr\+\_\+payload\+\_\+t}} $\ast$}]{payload,  }\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$}]{payload\+\_\+key }\end{DoxyParamCaption})}

Serialize-\/\+Then-\/\+Encrypt a payload

Payloads are serialized using protocol buffers (message.\+pb-\/c.\+h)


\begin{DoxyParams}{Parameters}
{\em payload} & the payload to encrypt \\
\hline
{\em engine} & a crypto engine capable of encryption using payload\+\_\+key \\
\hline
{\em payload\+\_\+key} & the key to use for encryption \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
an encrypted payload 
\end{DoxyReturn}
\mbox{\Hypertarget{group__wickr__payload_ga047613f464b15c627602399cd0c70c48}\label{group__wickr__payload_ga047613f464b15c627602399cd0c70c48}} 
\index{wickr\_payload@{wickr\_payload}!wickr\_payload\_serialize@{wickr\_payload\_serialize}}
\index{wickr\_payload\_serialize@{wickr\_payload\_serialize}!wickr\_payload@{wickr\_payload}}
\doxysubsubsection{\texorpdfstring{wickr\_payload\_serialize()}{wickr\_payload\_serialize()}}
{\footnotesize\ttfamily \mbox{\hyperlink{structwickr__buffer}{wickr\+\_\+buffer\+\_\+t}}$\ast$ wickr\+\_\+payload\+\_\+serialize (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{structwickr__payload}{wickr\+\_\+payload\+\_\+t}} $\ast$}]{payload }\end{DoxyParamCaption})}

Serialize a payload to a buffer


\begin{DoxyParams}{Parameters}
{\em payload} & the payload to serialize \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a buffer containing the properties of \textquotesingle{}payload\textquotesingle{} 
\end{DoxyReturn}
