SolarEnergy/esp32_device/main/storage.h

73 lines
1.2 KiB
C

/**
* Storage management
*/
#pragma once
#include <stdbool.h>
#include <stddef.h>
#ifdef __cplusplus
extern "C"
{
#endif
/**
* Initialize storage
*/
bool storage_init();
/**
* Write device name
*/
void storage_set_dev_name(const char *name);
/**
* Get current device name
*/
size_t storage_get_dev_name(char *dest);
/**
* Write private key
*/
void storage_set_priv_key(unsigned char *key, size_t len);
/**
* Get current private key
*/
size_t storage_get_priv_key(unsigned char *key);
/**
* Write secure origin
*/
void storage_set_secure_origin(const char *orig);
/**
* Get current secure origin
*/
size_t storage_get_secure_origin(char *dest);
/**
* Write root CA
*/
void storage_set_root_ca(const char *ca);
/**
* Get current root CA
*/
size_t storage_get_root_ca(char *dest);
/**
* Write device certificate
*/
void storage_set_dev_cert(const char *cert);
/**
* Get current device certificate
*/
size_t storage_get_dev_cert(char *dest);
#ifdef __cplusplus
}
#endif