2024-07-27 14:15:35 +00:00
|
|
|
/**
|
|
|
|
* Cryptographic functions
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Generate device private key, if required
|
2024-07-27 14:34:41 +00:00
|
|
|
*
|
|
|
|
* @returns true if a key was generated, false otherwise
|
2024-07-27 14:15:35 +00:00
|
|
|
*/
|
|
|
|
bool crypto_gen_priv_key();
|
|
|
|
|
2024-08-15 11:32:01 +00:00
|
|
|
/**
|
|
|
|
* Print current device private key
|
|
|
|
*/
|
|
|
|
void crypto_print_priv_key();
|
|
|
|
|
2024-08-16 09:51:33 +00:00
|
|
|
/**
|
|
|
|
* Get CSR
|
|
|
|
*
|
|
|
|
* @return NULL in case of failure or a buffer that must be
|
|
|
|
* freed in case of success
|
|
|
|
*/
|
|
|
|
char *crypto_get_csr();
|
|
|
|
|
2024-07-27 14:15:35 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|