Hi,
I have a question about getting the appkey from flash:
I am using the device state manager for key management. I do a ramdom generation of netkey and appkey on first start of a clean device. The netkey and appkey are stored in flash (PERSITENT STORAGE) .
After rebooting the device, I would like to load the netkey and appkey to configure new server nodes with the same keys.
Getting the netkey (subnetkey) is very easy with dsm_subnet_key_get(). Why it is so hard to get the appkey???? There is no dsm_appkey_get() function?
I have to use dsm_tx_secmat_get() and search in the scmat struct for the appkey which is stored as .p_key->key.
Is there a better/easier way to load the appkey from flash? Generating a new appkey each time on reboot (like in the provisioner example mesh v4.2) makes no sense for me.
Best regards,
Jeff