-
Notifications
You must be signed in to change notification settings - Fork 2
[ Example ] secure data storage zone access
This example demonstrates how to makes use of the STSE data storage APIs by performing following accesses/commands to the target STSAFE-A120 device:
- Query STSAFE-A total partition count
- Query STSAFE-A partitions information
- Read STSAFE-A counter zone 5
- Update STSAFE-A counter zone 5
Note zone IDs used in this example are aligned with STSAFE-A120 SPL04 personalization . Accesses parameters must be adapted for other device personalization.
The example applicative flowchart is illustrated below :
API and services used in the example :
- stse_init
- stse_data_storage_read_zone
- stse_data_storage_update_zone
When executed following logs can be seen on the host attached computer terminal window \n
----------------------------------------------------------------------------------------------------------------
- STSAFE-A120 secure data storage zone accesses example -
----------------------------------------------------------------------------------------------------------------
-
- description :
- This examples illustrates how to makes use of the STSAFE-A data storage APIs by performing following
- accesses/commands to the target STSAFE device
- o Query STSAFE-A total partition count
- o Query STSAFE-A partitions information
- o Read STSAFE-A zone 1
- o Update STSAFE-A zone 1
-
- Note : zone IDs used in this example are aligned with STSAFE-A110 SPL04 personalization
- Accesses parameters must be adapted for other device personalization
-
----------------------------------------------------------------------------------------------------------------
- Initialize peripheral STSAFE :
- stse_get_data_partitions_configuration
ID | COUNTER | DATA SEGMENT SIZE | READ AC CR | READ AC | UPDATE AC CR | UPDATE AC | COUNTER VAL
000 | x | 1000 | DENIED | ALLWAYS | ALLOWED | NEVER | 000000
001 | x | 0700 | DENIED | ALLWAYS | ALLOWED | ALLWAYS | 000000
002 | x | 0600 | DENIED | ALLWAYS | ALLOWED | ALLWAYS | 000000
003 | x | 0600 | DENIED | ALLWAYS | ALLOWED | ALLWAYS | 000000
004 | x | 1696 | DENIED | ALLWAYS | ALLOWED | ALLWAYS | 000000
005 | - | 0064 | DENIED | ALLWAYS | ALLOWED | ALLWAYS | 499990
006 | - | 0064 | DENIED | ALLWAYS | ALLOWED | ALLWAYS | 500000
007 | x | 1578 | DENIED | ALLWAYS | ALLOWED | ALLWAYS | 000000
- stsafe_data_storage_read_zone ( zone : 01 ; length : 100)
0xCD 0x91 0x49 0x72 0xC5 0x61 0xF7 0xEF 0x45 0x13 0x57 0x0F 0xF2 0xD2 0x8A 0xFF
0xA3 0x78 0x4D 0xF5 0x6D 0x3D 0x91 0x0B 0xAA 0x51 0x6E 0xAF 0x8C 0x49 0xA5 0x7D
0x1C 0xBF 0xBF 0xEB 0xA9 0xB1 0xCF 0x45 0xF7 0x88 0xBE 0x2A 0xD1 0xDE 0xD5 0x93
0x76 0x97 0xC9 0x5F 0xED 0xF2 0xE1 0x3C 0x2C 0x0F 0x76 0x9A 0x0A 0x08 0x13 0xF7
0xD4 0xEA 0x3B 0xEE 0x48 0x96 0xB7 0x37 0xF9 0xC8 0xE3 0x90 0xEE 0xD5 0x17 0x39
0x33 0x2A 0x72 0xEC 0x66 0x6B 0x2D 0x56 0x7E 0x07 0xD5 0xF3 0x0C 0x4A 0x51 0xEB
0xE1 0x2C 0x44 0xF3
- stsafe_data_storage_update_zone (zone = 01 - length = 100)
0x5B 0x9F 0xAD 0xF3 0xA9 0xB2 0x4D 0x4B 0x2D 0x21 0xCF 0xF2 0x9E 0xD7 0x1C 0x18
0x96 0x9E 0xD7 0x5D 0x28 0xD9 0x17 0x1B 0xFA 0x2F 0xF1 0x74 0x34 0x44 0xFA 0xD4
0x29 0x79 0x50 0xE9 0x2D 0x15 0x8E 0xCD 0x08 0xF8 0xD5 0xF8 0xFE 0xB8 0x42 0x09
0xE6 0xCF 0x61 0x13 0x09 0x5C 0x30 0xC5 0x74 0x60 0xF4 0x46 0x78 0xEF 0x32 0x94
0x83 0x19 0xA2 0xB0 0xF3 0x34 0x39 0x9B 0x0F 0xC5 0xAD 0xB4 0xE0 0x7D 0xB4 0x14
0x46 0x96 0x46 0xB8 0xF2 0x09 0x52 0xC0 0x53 0x98 0xC6 0x72 0xD0 0xDE 0xB4 0x0C
0xD7 0xCB 0xE9 0xA7
- stsafe_data_storage_read_zone ( zone : 01 ; length : 100)
0x5B 0x9F 0xAD 0xF3 0xA9 0xB2 0x4D 0x4B 0x2D 0x21 0xCF 0xF2 0x9E 0xD7 0x1C 0x18
0x96 0x9E 0xD7 0x5D 0x28 0xD9 0x17 0x1B 0xFA 0x2F 0xF1 0x74 0x34 0x44 0xFA 0xD4
0x29 0x79 0x50 0xE9 0x2D 0x15 0x8E 0xCD 0x08 0xF8 0xD5 0xF8 0xFE 0xB8 0x42 0x09
0xE6 0xCF 0x61 0x13 0x09 0x5C 0x30 0xC5 0x74 0x60 0xF4 0x46 0x78 0xEF 0x32 0x94
0x83 0x19 0xA2 0xB0 0xF3 0x34 0x39 0x9B 0x0F 0xC5 0xAD 0xB4 0xE0 0x7D 0xB4 0x14
0x46 0x96 0x46 0xB8 0xF2 0x09 0x52 0xC0 0x53 0x98 0xC6 0x72 0xD0 0xDE 0xB4 0x0C
0xD7 0xCB 0xE9 0xA7
Applicative scenario :
- Accessory/Consumable usage monitoring
- Accessory/Consumable Life/Cycle monitoring This example demonstrates how to makes use of the STSE data storage APIs by performing following accesses/commands to the target STSAFE-A120 device:
- Query STSAFE-A total partition count
- Query STSAFE-A partitions information
- Read STSAFE-A counter zone 5
- Update STSAFE-A counter zone 5
Note zone IDs used in this example are aligned with STSAFE-A120 SPL04 personalization . Accesses parameters must be adapted for other device personalization.
The example applicative flowchart is illustrated below :
API and services used in the example :
- stse_init
- stse_data--storage--read-_-zone
- stse--data--storage--update--zone
When executed following logs can be seen on the host attached computer terminal window \n
-_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_-
- STSAFE-A120 secure data storage zone accesses example -
-_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_-
-
- description :
- This examples illustrates how to makes use of the STSAFE-A data storage APIs by performing following
- accesses/commands to the target STSAFE device
- o Query STSAFE-A total partition count
- o Query STSAFE-A partitions information
- o Read STSAFE-A zone 1
- o Update STSAFE-A zone 1
-
- Note : zone IDs used in this example are aligned with STSAFE-A110 SPL04 personalization
- Accesses parameters must be adapted for other device personalization
-
-_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_--_-
- Initialize peripheral STSAFE :
- stse-_-get-_-data-_-partitions-_-configuration
ID | COUNTER | DATA SEGMENT SIZE | READ AC CR | READ AC | UPDATE AC CR | UPDATE AC | COUNTER VAL
000 | x | 1000 | DENIED | ALLWAYS | ALLOWED | NEVER | 000000
001 | x | 0700 | DENIED | ALLWAYS | ALLOWED | ALLWAYS | 000000
002 | x | 0600 | DENIED | ALLWAYS | ALLOWED | ALLWAYS | 000000
003 | x | 0600 | DENIED | ALLWAYS | ALLOWED | ALLWAYS | 000000
004 | x | 1696 | DENIED | ALLWAYS | ALLOWED | ALLWAYS | 000000
005 | - | 0064 | DENIED | ALLWAYS | ALLOWED | ALLWAYS | 499990
006 | - | 0064 | DENIED | ALLWAYS | ALLOWED | ALLWAYS | 500000
007 | x | 1578 | DENIED | ALLWAYS | ALLOWED | ALLWAYS | 000000
- stsafe-_-data-_-storage-_-read-_-zone ( zone : 01 ; length : 100)
0xCD 0x91 0x49 0x72 0xC5 0x61 0xF7 0xEF 0x45 0x13 0x57 0x0F 0xF2 0xD2 0x8A 0xFF
0xA3 0x78 0x4D 0xF5 0x6D 0x3D 0x91 0x0B 0xAA 0x51 0x6E 0xAF 0x8C 0x49 0xA5 0x7D
0x1C 0xBF 0xBF 0xEB 0xA9 0xB1 0xCF 0x45 0xF7 0x88 0xBE 0x2A 0xD1 0xDE 0xD5 0x93
0x76 0x97 0xC9 0x5F 0xED 0xF2 0xE1 0x3C 0x2C 0x0F 0x76 0x9A 0x0A 0x08 0x13 0xF7
0xD4 0xEA 0x3B 0xEE 0x48 0x96 0xB7 0x37 0xF9 0xC8 0xE3 0x90 0xEE 0xD5 0x17 0x39
0x33 0x2A 0x72 0xEC 0x66 0x6B 0x2D 0x56 0x7E 0x07 0xD5 0xF3 0x0C 0x4A 0x51 0xEB
0xE1 0x2C 0x44 0xF3
- stsafe-_-data-_-storage-_-update-_-zone (zone = 01 - length = 100)
0x5B 0x9F 0xAD 0xF3 0xA9 0xB2 0x4D 0x4B 0x2D 0x21 0xCF 0xF2 0x9E 0xD7 0x1C 0x18
0x96 0x9E 0xD7 0x5D 0x28 0xD9 0x17 0x1B 0xFA 0x2F 0xF1 0x74 0x34 0x44 0xFA 0xD4
0x29 0x79 0x50 0xE9 0x2D 0x15 0x8E 0xCD 0x08 0xF8 0xD5 0xF8 0xFE 0xB8 0x42 0x09
0xE6 0xCF 0x61 0x13 0x09 0x5C 0x30 0xC5 0x74 0x60 0xF4 0x46 0x78 0xEF 0x32 0x94
0x83 0x19 0xA2 0xB0 0xF3 0x34 0x39 0x9B 0x0F 0xC5 0xAD 0xB4 0xE0 0x7D 0xB4 0x14
0x46 0x96 0x46 0xB8 0xF2 0x09 0x52 0xC0 0x53 0x98 0xC6 0x72 0xD0 0xDE 0xB4 0x0C
0xD7 0xCB 0xE9 0xA7
- stsafe-_-data-_-storage-_-read-_-zone ( zone : 01 ; length : 100)
0x5B 0x9F 0xAD 0xF3 0xA9 0xB2 0x4D 0x4B 0x2D 0x21 0xCF 0xF2 0x9E 0xD7 0x1C 0x18
0x96 0x9E 0xD7 0x5D 0x28 0xD9 0x17 0x1B 0xFA 0x2F 0xF1 0x74 0x34 0x44 0xFA 0xD4
0x29 0x79 0x50 0xE9 0x2D 0x15 0x8E 0xCD 0x08 0xF8 0xD5 0xF8 0xFE 0xB8 0x42 0x09
0xE6 0xCF 0x61 0x13 0x09 0x5C 0x30 0xC5 0x74 0x60 0xF4 0x46 0x78 0xEF 0x32 0x94
0x83 0x19 0xA2 0xB0 0xF3 0x34 0x39 0x9B 0x0F 0xC5 0xAD 0xB4 0xE0 0x7D 0xB4 0x14
0x46 0x96 0x46 0xB8 0xF2 0x09 0x52 0xC0 0x53 0x98 0xC6 0x72 0xD0 0xDE 0xB4 0x0C
0xD7 0xCB 0xE9 0xA7
Applicative scenario :
- Accessory/Consumable usage monitoring
- Accessory/Consumable Life/Cycle monitoring
- STSAFE-A120 Secure Element
- STSAFE-A110 Secure Element
- Feature Description
- Standard Use-cases
- Product Perso Profile
- STSAFE-A120 : X-NUCLEO-ESE01A1
- STSAFE-A110 : X-NUCLEO-SAFEA1
- Software Package Architecture
- Getting Started with Software Package
-
Project examples list
- Project template
- Echo loop
- Random number generation
- NIST P-256 key pair generation
- NIST P-512 key pair generation
- BRAINPOOL P-512 Key Pair Generation
- Edwards-25519 Key Pair Generation
- Secure Data Storage Zone Access
- Secure data storage counter access
- Hash
- Device authentication
- Multi-step device authentication
- Host key provisioning
- Host key provisioning (Wrapped)
- Command Access Condition provisioning
- Secret or key wrapping
- ECDH
- Symmetric key provisioning Control Fields
- Symmetric key establishment AES-128 CMAC
- Symmetric key establishment AES-256 CCM
- Symmetric Key Management AES-128 CMAC
- Symmetric Key Management AES-256 CCM
- Wrapped Symmetric Key Provisioning - AES-128 CMAC
- Wrapped Symmetric Key Provisioning - AES-256 CCM*