# API

The API for secure storage is defined in bl_simple_filer.h and bl_file_encryption.h. The former provides the basic file system handler, and the latter provides the encryption layer. See the API reference or the files in the sample implementation for details.

Some important functions are as follows.

From bl_simple_filer.h:

BL_FStoreStatus_t BL_FStoreWrite(BL_FSFileId_t id,

uint8_t *buffer, uint16_t size, uint16_t flags);

BL_FStoreStatus_t BL_FStoreWrite(BL_FSFileId_t id,

uint8_t *buffer, uint16_t size, uint16_t flags);

BL_FStoreStatus_t BL_FStoreDelete(BL_FSFileId_t id);

BL_FStoreStatus_t BL_FStoreFileList(

uint8_t *buffer, uint16_t *maxsize, bool showHidden);

From bl_file_encryption.h:

BL_EncryptionStatus_t BL_EncryptBuffer(uint8_t *buffer, size_t length);

BL_EncryptionStatus_t BL_DecryptBuffer(uint8_t *buffer, size_t length);