X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fmeshlink.h;h=c8c471847f48b0bbb031185413fbac665e4a2eed;hb=1442d234fb6681e32b10348a6c7b226c11629203;hp=96f2d183e222e0163a796a38d6056a85d3cf191a;hpb=1622803438b8c4bfff50bedfae6cd809e27fa075;p=meshlink diff --git a/src/meshlink.h b/src/meshlink.h index 96f2d183..c8c47184 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 char *new_key, size_t new_keylen); + #ifdef __cplusplus } #endif