|
wickr-crypto-c
|
Data Structures | |
| struct | wickr_transport_packet |
| A packet used within the wickr_transport_ctx to package up data and related metadata + authentication in one serializable structure. More... | |
Functions | |
| wickr_transport_packet_t * | wickr_transport_packet_create (wickr_transport_packet_meta_t meta, wickr_buffer_t *body) |
| wickr_transport_packet_t * | wickr_transport_packet_copy (const wickr_transport_packet_t *pkt) |
| void | wickr_transport_packet_destroy (wickr_transport_packet_t **pkt) |
| wickr_buffer_t * | wickr_transport_packet_serialize (const wickr_transport_packet_t *pkt) |
| wickr_transport_packet_t * | wickr_transport_packet_create_from_buffer (const wickr_buffer_t *buffer) |
| bool | wickr_transport_packet_sign (wickr_transport_packet_t *pkt, const wickr_crypto_engine_t *engine, const wickr_identity_chain_t *identity_chain) |
| bool | wickr_transport_packet_verify (const wickr_transport_packet_t *packet, const wickr_crypto_engine_t *engine, wickr_identity_chain_t *identity_chain) |
| wickr_transport_packet_t* wickr_transport_packet_copy | ( | const wickr_transport_packet_t * | pkt | ) |
Make a deep copy of a transport packet
| pkt | the transport packet to make a copy of |
| wickr_transport_packet_t* wickr_transport_packet_create | ( | wickr_transport_packet_meta_t | meta, |
| wickr_buffer_t * | body | ||
| ) |
Create a transport packet
| meta | metadata describing body |
| body | the main contents of the packet |
| wickr_transport_packet_t* wickr_transport_packet_create_from_buffer | ( | const wickr_buffer_t * | buffer | ) |
Create a transport packet from a serialized transport packet
| buffer | a buffer that was created by a call to wickr_transport_packet_serialize |
buffer or NULL if the buffer is corrupt or does not represent a transport packet | void wickr_transport_packet_destroy | ( | wickr_transport_packet_t ** | pkt | ) |
Destroy a transport packet
| pkt | a pointer to the transport packet to destroy. All properties of *pkt will also be destroyed |
| wickr_buffer_t* wickr_transport_packet_serialize | ( | const wickr_transport_packet_t * | pkt | ) |
Serialize a transport packet down to a buffer for transfer
| pkt | the packet to serialize |
pkt or NULL if serialization fails | bool wickr_transport_packet_sign | ( | wickr_transport_packet_t * | pkt, |
| const wickr_crypto_engine_t * | engine, | ||
| const wickr_identity_chain_t * | identity_chain | ||
| ) |
Sign a transport packet to authenticate it using an identity chain. Upon successful signing, the mac type of pkt will be set based on the type of key used for the signature
| pkt | the packet to sign |
| engine | a pointer to a crypto engine that support digital signatures |
| identity_chain | an identity chain that at minimum contains the private key for a node identity in order to sign the packet |
| bool wickr_transport_packet_verify | ( | const wickr_transport_packet_t * | packet, |
| const wickr_crypto_engine_t * | engine, | ||
| wickr_identity_chain_t * | identity_chain | ||
| ) |
Verify a packet that was signed by a call to wickr_transport_packet_sign
| packet | the packet to verify |
| engine | a pointer to a crypto engine that supports verifying digital signatures |
| identity_chain | the public identity chain that is believed to have signed packet |
packet was signed by identity_chain