Skip to content

Better encryption support, default value to `getString()`

Latest
Compare
Choose a tag to compare
@rpolitex rpolitex released this 30 Aug 20:47

Overview

  1. Support for specific encryption-related use-cases:
    • non-encrypted NVS on Encryption-enabled system
    • use encryption keys, not stored in the key-partition
  2. Added default value to getString()
  3. Added format() function to clear and format the whole NVS partition
  4. Added optional partition de-init during close()

Support for specific encryption-related use-cases

There are some cases when nvs_flash_init() works not perfectly:

  1. You need access to Non-encrypted NVS on Encryption-enabled system (CONFIG_NVS_ENCRYPTION=1).
    Use usual begin(String namespaceNvs).
  2. You store NVS keys in external secure storage (or hardcoded) (instead of in NVS Key Partition).
    Use begin(String namespaceNvs, nvs_sec_cfg_t *keys). See some details here.
    NOTE: You cannot use encrypted and non-encrypted NVS namespaces simultaneously (because ArduinoNvs uses one NVS_DEFAULT_PART_NAME partition for all namespaces).
// Example with hardcoded keys
    nvs_sec_cfg_t keys = {
        .eky = {1, 2, 3, 4, 5},
        .tky = {6, 7, 8, 9, 10}
    };
    ArduinoNvs E;
    E.begin("TEST1", &keys));

    // use lib as usual