|
wickr-crypto-c
|
Data Structures | |
| struct | wickr_node |
| Represents a message destination at a point in time. More... | |
Enumerations | |
| enum | wickr_node_status { NODE_STATUS_UNKNOWN , NODE_STATUS_VALID , NODE_STATUS_INVALID } |
| enum wickr_node_status |
Node status
UNKNOWN - Signature validation has never been attempted on the node VALID - Signature validation has been attempted and has passed on node INVALID - Signature validation has been attempted and has failed on node
| wickr_node_array_t* wickr_node_array_copy | ( | const wickr_node_array_t * | array | ) |
Make a deep copy of a node array
| array | the array to copy |
| void wickr_node_array_destroy | ( | wickr_node_array_t ** | array | ) |
Destroy a node array
NOTE: Nodes in the array are not destroyed, only the container array
| array | the array to destroy |
| wickr_node_t* wickr_node_array_fetch_item | ( | const wickr_array_t * | array, |
| uint32_t | index | ||
| ) |
Fetch an item in the node array
NOTE: a fetched node is not copied out of the array, it is still owned by the array
| array | the array to fetch from |
| index | the index in the array to fetch from |
| wickr_node_array_t* wickr_node_array_new | ( | uint32_t | node_count | ) |
Create an array of nodes
| node_count | the number of nodes the array should hold |
| bool wickr_node_array_set_item | ( | wickr_array_t * | array, |
| uint32_t | index, | ||
| wickr_node_t * | node | ||
| ) |
Set an item in the node array
NOTE: 'node' is not copied into the array, ownership is simply transferred to the array
| array | the array to set a node into |
| index | the index to place the node into the array |
| node | the node to place at 'index' in the array |
| wickr_node_t* wickr_node_copy | ( | const wickr_node_t * | source | ) |
Copy an node
| source | the node to copy |
| wickr_node_t* wickr_node_create | ( | wickr_buffer_t * | dev_id, |
| wickr_identity_chain_t * | id_chain, | ||
| wickr_ephemeral_keypair_t * | ephemeral_keypair | ||
| ) |
Create a node from components
| dev_id | see 'wickr_node' property documentation |
| id_chain | see 'wickr_node' property documentation |
| ephemeral_keypair | see 'wickr_node' property documentation |
| wickr_node_t* wickr_node_create_from_buffer | ( | const wickr_buffer_t * | buffer, |
| const wickr_crypto_engine_t * | engine | ||
| ) |
Create a node from a buffer that was created with 'wickr_node_serialize'
| buffer | the buffer that contains a serialized representation of a node |
| engine | the crypto engine to use to import the key components of the node |
| void wickr_node_destroy | ( | wickr_node_t ** | node | ) |
Destroy a node
| node | a pointer to the node to destroy. All properties of '*node' will also be destroyed |
| bool wickr_node_rotate_keypair | ( | wickr_node_t * | node, |
| wickr_ephemeral_keypair_t * | new_keypair, | ||
| bool | copy | ||
| ) |
Rotate in a new ephemeral key pair for message sending
NOTE: This function DOES NOT ensure that new_keypair is signed properly. To do that, you must call 'wickr_node_verify_signature_chain' after rotation
| node | the node to rotate 'new_keypair' into |
| new_keypair | the key pair to rotate into place |
| copy | if true, perform a deep copy of 'new_keypair' before rotating |
| wickr_buffer_t* wickr_node_serialize | ( | const wickr_node_t * | node | ) |
Serialize a node to bytes
| node | the node to serialize |
| bool wickr_node_verify_signature_chain | ( | wickr_node_t * | node, |
| const wickr_crypto_engine_t * | engine | ||
| ) |
Verify the integrity of the signature chain for a node
In order to be valid, the ephemeral keypair's signature must validate with the id_chain's 'node' public signing key. The id_chain's 'node' signature must validate with the id_chain's 'root' public signing key
| node | the node to verify |
| engine | a crypto engine capable of verifying EC signatures |