X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmeshlink.h;h=6a1c758a65011666b5f8731dd02c40f079223d72;hb=3be622ad230c70e9753f9f9737333a2f803b125e;hp=96f2d183e222e0163a796a38d6056a85d3cf191a;hpb=53522b1c11222273c7b41f72b374e759d13b2165;p=meshlink diff --git a/src/meshlink.h b/src/meshlink.h index 96f2d183..6a1c758a 100644 --- a/src/meshlink.h +++ b/src/meshlink.h @@ -1176,6 +1176,19 @@ extern void meshlink_hint_address(meshlink_handle_t *mesh, meshlink_node_t *node */ extern void meshlink_enable_discovery(meshlink_handle_t *mesh, bool enable); +/// Performs key rotation for an encrypted storage + +/** This rotates the (master) key for an encrypted storage and discards the old key + * if the call succeeded. This is an atomic call. + * + * @param mesh A handle which represents an instance of MeshLink. + * @param key A pointer to the new key used to encrypt storage. + * @param keylen The length of the new key in bytes. + * + * @return This function returns true if the key rotation for the encrypted storage succeeds, false otherwise. + */ +extern bool meshlink_encrypted_key_rotate(meshlink_handle_t *mesh, const void *new_key, size_t new_keylen); + #ifdef __cplusplus } #endif