3.9. Using Platform SCP Keys from File System¶
Warning
Keeping keys in plain on file system is not secure. This mechanism is just to test quick prototyping / testing.
Note
This is valid only for hosts with filesystem access e.g. : Windows/Linux
CLI Tool does not use this mechanism.
Using this mechanism, pre-compiled windows/linux demo examples can pick up platform SCP Keys from file system.
Create a file as set by
EX_SSS_SCP03_FILE_PATH
You can over-ride value for this variable in
sss/ex/inc/ex_sss_scp03_keys.h
For Android
#define EX_SSS_SCP03_FILE_DIR "/data/vendor/SE05x/" #define EX_SSS_SCP03_FILE_PATH EX_SSS_SCP03_FILE_DIR "plain_scp.txt"
For Linux
#define EX_SSS_SCP03_FILE_DIR "/tmp/SE05X/" #define EX_SSS_SCP03_FILE_PATH EX_SSS_SCP03_FILE_DIR "plain_scp.txt"
For Windows
#define EX_SSS_SCP03_FILE_DIR "C:\\nxp\\SE05X\\" #define EX_SSS_SCP03_FILE_PATH EX_SSS_SCP03_FILE_DIR "plain_scp.txt"
Let us assume the Platform SCP03 keys provisioned in SE050 are as follows
ENC is
35C256458958A34F6136155F8209D6CD
MAC is
AF177D5DBDF7C0D5C10A05B9F1607F78
DEK is
A1BC8438BF77935B361A4425FE79FA29
The format of a reference file is as below:
# This is a comment, empty lines and comment lines allowed. ENC 35C256458958A34F6136155F8209D6CD # Trailing comment MAC AF177D5DBDF7C0D5C10A05B9F1607F78 # Optional trailing comment DEK A1BC8438BF77935B361A4425FE79FA29 # Optional trailing comment
The Default Platform SCP keys for ease of use configurations are present in https://www.nxp.com/docs/en/application-note/AN12436.pdf
3.9.1. How to Run examples with Platform SCP03 keys¶
Once the plain_scp.txt
file is filled with the correct
SCP keys for the sample, run any example e.g.: ECC Example.
The example will automatically pick up the keys from
the file at this location, if the file exists.
If the file does not exist, it uses keys from pre-compiled
values in the example.