libsignal-protocol-c  master
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
signal_protocol_pre_key_store Struct Reference

Public Attributes

int(* load_pre_key )(signal_buffer **record, uint32_t pre_key_id, void *user_data)
 
int(* store_pre_key )(uint32_t pre_key_id, uint8_t *record, size_t record_len, void *user_data)
 
int(* contains_pre_key )(uint32_t pre_key_id, void *user_data)
 
int(* remove_pre_key )(uint32_t pre_key_id, void *user_data)
 
void(* destroy_func )(void *user_data)
 
void * user_data
 

Member Data Documentation

◆ contains_pre_key

int(* signal_protocol_pre_key_store::contains_pre_key) (uint32_t pre_key_id, void *user_data)

Determine whether there is a committed PreKey record matching the provided ID.

Parameters
pre_key_idA PreKey record ID.
Returns
1 if the store has a record for the PreKey ID, 0 otherwise

◆ destroy_func

void(* signal_protocol_pre_key_store::destroy_func) (void *user_data)

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

◆ load_pre_key

int(* signal_protocol_pre_key_store::load_pre_key) (signal_buffer **record, uint32_t pre_key_id, void *user_data)

Load a local serialized PreKey record.

Parameters
recordpointer to a newly allocated buffer containing the record, if found. Unset if no record was found. The Signal Protocol library is responsible for freeing this buffer.
pre_key_idthe ID of the local serialized PreKey record
Return values
SG_SUCCESSif the key was found
SG_ERR_INVALID_KEY_IDif the key could not be found

◆ remove_pre_key

int(* signal_protocol_pre_key_store::remove_pre_key) (uint32_t pre_key_id, void *user_data)

Delete a PreKey record from local storage.

Parameters
pre_key_idThe ID of the PreKey record to remove.
Returns
0 on success, negative on failure

◆ store_pre_key

int(* signal_protocol_pre_key_store::store_pre_key) (uint32_t pre_key_id, uint8_t *record, size_t record_len, void *user_data)

Store a local serialized PreKey record.

Parameters
pre_key_idthe ID of the PreKey record to store.
recordpointer to a buffer containing the serialized record
record_lenlength of the serialized record
Returns
0 on success, negative on failure

◆ user_data

void* signal_protocol_pre_key_store::user_data

User data pointer


The documentation for this struct was generated from the following file: