\hypertarget{structsignal__protocol__identity__key__store}{}\section{signal\+\_\+protocol\+\_\+identity\+\_\+key\+\_\+store Struct Reference}
\label{structsignal__protocol__identity__key__store}\index{signal\+\_\+protocol\+\_\+identity\+\_\+key\+\_\+store@{signal\+\_\+protocol\+\_\+identity\+\_\+key\+\_\+store}}


{\ttfamily \#include $<$signal\+\_\+protocol.\+h$>$}

\subsection*{Data Fields}
\begin{DoxyCompactItemize}
\item 
int($\ast$ \hyperlink{structsignal__protocol__identity__key__store_a3c8462b7e2e6baf7340c05ad98ee5c17}{get\+\_\+identity\+\_\+key\+\_\+pair} )(\hyperlink{structsignal__buffer}{signal\+\_\+buffer} $\ast$$\ast$public\+\_\+data, \hyperlink{structsignal__buffer}{signal\+\_\+buffer} $\ast$$\ast$private\+\_\+data, void $\ast$\hyperlink{structsignal__protocol__identity__key__store_a0f53d287ac7c064d1a49d4bd93ca1cb9}{user\+\_\+data})
\item 
int($\ast$ \hyperlink{structsignal__protocol__identity__key__store_a91bc92cbdd0bdead22c001a06bbcd64a}{get\+\_\+local\+\_\+registration\+\_\+id} )(void $\ast$\hyperlink{structsignal__protocol__identity__key__store_a0f53d287ac7c064d1a49d4bd93ca1cb9}{user\+\_\+data}, \hyperlink{uthash_8h_a435d1572bf3f880d55459d9805097f62}{uint32\+\_\+t} $\ast$registration\+\_\+id)
\item 
int($\ast$ \hyperlink{structsignal__protocol__identity__key__store_a4021855670391bf06802b4ac2ecb5b83}{save\+\_\+identity} )(const \hyperlink{structsignal__protocol__address}{signal\+\_\+protocol\+\_\+address} $\ast$address, \hyperlink{uthash_8h_aba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t} $\ast$key\+\_\+data, size\+\_\+t key\+\_\+len, void $\ast$\hyperlink{structsignal__protocol__identity__key__store_a0f53d287ac7c064d1a49d4bd93ca1cb9}{user\+\_\+data})
\item 
int($\ast$ \hyperlink{structsignal__protocol__identity__key__store_a5c1284e2011140705a6b37ab7d7ae436}{is\+\_\+trusted\+\_\+identity} )(const \hyperlink{structsignal__protocol__address}{signal\+\_\+protocol\+\_\+address} $\ast$address, \hyperlink{uthash_8h_aba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t} $\ast$key\+\_\+data, size\+\_\+t key\+\_\+len, void $\ast$\hyperlink{structsignal__protocol__identity__key__store_a0f53d287ac7c064d1a49d4bd93ca1cb9}{user\+\_\+data})
\item 
void($\ast$ \hyperlink{structsignal__protocol__identity__key__store_aff3fc05d69acc3eb8074e6d587bbffe2}{destroy\+\_\+func} )(void $\ast$\hyperlink{structsignal__protocol__identity__key__store_a0f53d287ac7c064d1a49d4bd93ca1cb9}{user\+\_\+data})
\item 
void $\ast$ \hyperlink{structsignal__protocol__identity__key__store_a0f53d287ac7c064d1a49d4bd93ca1cb9}{user\+\_\+data}
\end{DoxyCompactItemize}


\subsection{Detailed Description}


Definition at line 592 of file signal\+\_\+protocol.\+h.



\subsection{Field Documentation}
\mbox{\Hypertarget{structsignal__protocol__identity__key__store_aff3fc05d69acc3eb8074e6d587bbffe2}\label{structsignal__protocol__identity__key__store_aff3fc05d69acc3eb8074e6d587bbffe2}} 
\index{signal\+\_\+protocol\+\_\+identity\+\_\+key\+\_\+store@{signal\+\_\+protocol\+\_\+identity\+\_\+key\+\_\+store}!destroy\+\_\+func@{destroy\+\_\+func}}
\index{destroy\+\_\+func@{destroy\+\_\+func}!signal\+\_\+protocol\+\_\+identity\+\_\+key\+\_\+store@{signal\+\_\+protocol\+\_\+identity\+\_\+key\+\_\+store}}
\subsubsection{\texorpdfstring{destroy\+\_\+func}{destroy\_func}}
{\footnotesize\ttfamily void($\ast$ destroy\+\_\+func) (void $\ast$\hyperlink{structsignal__protocol__identity__key__store_a0f53d287ac7c064d1a49d4bd93ca1cb9}{user\+\_\+data})}

Function called to perform cleanup when the data store context is being destroyed. 

Definition at line 655 of file signal\+\_\+protocol.\+h.

\mbox{\Hypertarget{structsignal__protocol__identity__key__store_a3c8462b7e2e6baf7340c05ad98ee5c17}\label{structsignal__protocol__identity__key__store_a3c8462b7e2e6baf7340c05ad98ee5c17}} 
\index{signal\+\_\+protocol\+\_\+identity\+\_\+key\+\_\+store@{signal\+\_\+protocol\+\_\+identity\+\_\+key\+\_\+store}!get\+\_\+identity\+\_\+key\+\_\+pair@{get\+\_\+identity\+\_\+key\+\_\+pair}}
\index{get\+\_\+identity\+\_\+key\+\_\+pair@{get\+\_\+identity\+\_\+key\+\_\+pair}!signal\+\_\+protocol\+\_\+identity\+\_\+key\+\_\+store@{signal\+\_\+protocol\+\_\+identity\+\_\+key\+\_\+store}}
\subsubsection{\texorpdfstring{get\+\_\+identity\+\_\+key\+\_\+pair}{get\_identity\_key\_pair}}
{\footnotesize\ttfamily int($\ast$ get\+\_\+identity\+\_\+key\+\_\+pair) (\hyperlink{structsignal__buffer}{signal\+\_\+buffer} $\ast$$\ast$public\+\_\+data, \hyperlink{structsignal__buffer}{signal\+\_\+buffer} $\ast$$\ast$private\+\_\+data, void $\ast$\hyperlink{structsignal__protocol__identity__key__store_a0f53d287ac7c064d1a49d4bd93ca1cb9}{user\+\_\+data})}

Get the local client\textquotesingle{}s identity key pair.


\begin{DoxyParams}{Parameters}
{\em public\+\_\+data} & pointer to a newly allocated buffer containing the public key, if found. Unset if no record was found. The Signal Protocol library is responsible for freeing this buffer. \\
\hline
{\em private\+\_\+data} & pointer to a newly allocated buffer containing the private key, if found. Unset if no record was found. The Signal Protocol library is responsible for freeing this buffer. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success, negative on failure 
\end{DoxyReturn}


Definition at line 604 of file signal\+\_\+protocol.\+h.

\mbox{\Hypertarget{structsignal__protocol__identity__key__store_a91bc92cbdd0bdead22c001a06bbcd64a}\label{structsignal__protocol__identity__key__store_a91bc92cbdd0bdead22c001a06bbcd64a}} 
\index{signal\+\_\+protocol\+\_\+identity\+\_\+key\+\_\+store@{signal\+\_\+protocol\+\_\+identity\+\_\+key\+\_\+store}!get\+\_\+local\+\_\+registration\+\_\+id@{get\+\_\+local\+\_\+registration\+\_\+id}}
\index{get\+\_\+local\+\_\+registration\+\_\+id@{get\+\_\+local\+\_\+registration\+\_\+id}!signal\+\_\+protocol\+\_\+identity\+\_\+key\+\_\+store@{signal\+\_\+protocol\+\_\+identity\+\_\+key\+\_\+store}}
\subsubsection{\texorpdfstring{get\+\_\+local\+\_\+registration\+\_\+id}{get\_local\_registration\_id}}
{\footnotesize\ttfamily int($\ast$ get\+\_\+local\+\_\+registration\+\_\+id) (void $\ast$\hyperlink{structsignal__protocol__identity__key__store_a0f53d287ac7c064d1a49d4bd93ca1cb9}{user\+\_\+data}, \hyperlink{uthash_8h_a435d1572bf3f880d55459d9805097f62}{uint32\+\_\+t} $\ast$registration\+\_\+id)}

Return the local client\textquotesingle{}s registration ID.

Clients should maintain a registration ID, a random number between 1 and 16380 that\textquotesingle{}s generated once at install time.


\begin{DoxyParams}{Parameters}
{\em registration\+\_\+id} & pointer to be set to the local client\textquotesingle{}s registration ID, if it was successfully retrieved. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success, negative on failure 
\end{DoxyReturn}


Definition at line 616 of file signal\+\_\+protocol.\+h.

\mbox{\Hypertarget{structsignal__protocol__identity__key__store_a5c1284e2011140705a6b37ab7d7ae436}\label{structsignal__protocol__identity__key__store_a5c1284e2011140705a6b37ab7d7ae436}} 
\index{signal\+\_\+protocol\+\_\+identity\+\_\+key\+\_\+store@{signal\+\_\+protocol\+\_\+identity\+\_\+key\+\_\+store}!is\+\_\+trusted\+\_\+identity@{is\+\_\+trusted\+\_\+identity}}
\index{is\+\_\+trusted\+\_\+identity@{is\+\_\+trusted\+\_\+identity}!signal\+\_\+protocol\+\_\+identity\+\_\+key\+\_\+store@{signal\+\_\+protocol\+\_\+identity\+\_\+key\+\_\+store}}
\subsubsection{\texorpdfstring{is\+\_\+trusted\+\_\+identity}{is\_trusted\_identity}}
{\footnotesize\ttfamily int($\ast$ is\+\_\+trusted\+\_\+identity) (const \hyperlink{structsignal__protocol__address}{signal\+\_\+protocol\+\_\+address} $\ast$address, \hyperlink{uthash_8h_aba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t} $\ast$key\+\_\+data, size\+\_\+t key\+\_\+len, void $\ast$\hyperlink{structsignal__protocol__identity__key__store_a0f53d287ac7c064d1a49d4bd93ca1cb9}{user\+\_\+data})}

Verify a remote client\textquotesingle{}s identity key.

Determine whether a remote client\textquotesingle{}s identity is trusted. Convention is that the Text\+Secure protocol is \textquotesingle{}trust on first use.\textquotesingle{} This means that an identity key is considered \textquotesingle{}trusted\textquotesingle{} if there is no entry for the recipient in the local store, or if it matches the saved key for a recipient in the local store. Only if it mismatches an entry in the local store is it considered \textquotesingle{}untrusted.\textquotesingle{}


\begin{DoxyParams}{Parameters}
{\em address} & the address of the remote client \\
\hline
{\em identity\+Key} & The identity key to verify. \\
\hline
{\em key\+\_\+data} & Pointer to the identity key to verify \\
\hline
{\em key\+\_\+len} & Length of the identity key to verify \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
1 if trusted, 0 if untrusted, negative on failure 
\end{DoxyReturn}


Definition at line 649 of file signal\+\_\+protocol.\+h.

\mbox{\Hypertarget{structsignal__protocol__identity__key__store_a4021855670391bf06802b4ac2ecb5b83}\label{structsignal__protocol__identity__key__store_a4021855670391bf06802b4ac2ecb5b83}} 
\index{signal\+\_\+protocol\+\_\+identity\+\_\+key\+\_\+store@{signal\+\_\+protocol\+\_\+identity\+\_\+key\+\_\+store}!save\+\_\+identity@{save\+\_\+identity}}
\index{save\+\_\+identity@{save\+\_\+identity}!signal\+\_\+protocol\+\_\+identity\+\_\+key\+\_\+store@{signal\+\_\+protocol\+\_\+identity\+\_\+key\+\_\+store}}
\subsubsection{\texorpdfstring{save\+\_\+identity}{save\_identity}}
{\footnotesize\ttfamily int($\ast$ save\+\_\+identity) (const \hyperlink{structsignal__protocol__address}{signal\+\_\+protocol\+\_\+address} $\ast$address, \hyperlink{uthash_8h_aba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t} $\ast$key\+\_\+data, size\+\_\+t key\+\_\+len, void $\ast$\hyperlink{structsignal__protocol__identity__key__store_a0f53d287ac7c064d1a49d4bd93ca1cb9}{user\+\_\+data})}

Save a remote client\textquotesingle{}s identity key 

Store a remote client\textquotesingle{}s identity key as trusted. The value of key\+\_\+data may be null. In this case remove the key data from the identity store, but retain any metadata that may be kept alongside it.


\begin{DoxyParams}{Parameters}
{\em address} & the address of the remote client \\
\hline
{\em key\+\_\+data} & Pointer to the remote client\textquotesingle{}s identity key, may be null \\
\hline
{\em key\+\_\+len} & Length of the remote client\textquotesingle{}s identity key \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success, negative on failure 
\end{DoxyReturn}


Definition at line 631 of file signal\+\_\+protocol.\+h.

\mbox{\Hypertarget{structsignal__protocol__identity__key__store_a0f53d287ac7c064d1a49d4bd93ca1cb9}\label{structsignal__protocol__identity__key__store_a0f53d287ac7c064d1a49d4bd93ca1cb9}} 
\index{signal\+\_\+protocol\+\_\+identity\+\_\+key\+\_\+store@{signal\+\_\+protocol\+\_\+identity\+\_\+key\+\_\+store}!user\+\_\+data@{user\+\_\+data}}
\index{user\+\_\+data@{user\+\_\+data}!signal\+\_\+protocol\+\_\+identity\+\_\+key\+\_\+store@{signal\+\_\+protocol\+\_\+identity\+\_\+key\+\_\+store}}
\subsubsection{\texorpdfstring{user\+\_\+data}{user\_data}}
{\footnotesize\ttfamily void$\ast$ user\+\_\+data}

User data pointer 

Definition at line 658 of file signal\+\_\+protocol.\+h.



The documentation for this struct was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
src/\hyperlink{signal__protocol_8h}{signal\+\_\+protocol.\+h}\end{DoxyCompactItemize}
