@@ -78,39 +78,41 @@ get_msg_sha256 "<msg>"
7878 Get the SHA256 digest for the given message
7979 " <msg>" Message for SHA256 digest calculation
8080
81- tee_sec_stg_gen_key < slot_id> < key_type>
82- Generate and store a new key of the specified type in the given TEE secure
83- storage slot
84- < slot_id> TEE Secure storage slot for storing the key
85- < key_type> Key type (0: ECDSA_SECP256R1, 1: AES256)
86-
87- tee_sec_stg_sign < slot_id> < msg_sha256>
88- Sign a message using the ECDSA keypair stored in the given slot ID and verify
89- the signature
90- < slot_id> TEE Secure storage slot storing the ecdsa-secp256r1 keypair
81+ tee_sec_stg_gen_key < key_id> < key_type>
82+ Generate and store a new key of the specified type with the given ID
83+ < key_id> TEE Secure storage key ID
84+ < key_type> Key type (0: AES256, 1: ECDSA_SECP256R1)
85+
86+ tee_sec_stg_sign < key_id> < msg_sha256>
87+ Sign a message using the ECDSA keypair stored with the given key ID and
88+ verify the signature
89+ < key_id> TEE Secure storage key ID
9190 < msg_sha256> SHA256 digest of the message to be signed and verified
9291
93- tee_sec_stg_encrypt < slot_id > < plaintext>
94- Encrypt data using AES-GCM with a key from secure storage
95- < slot_id > TEE Secure storage slot storing the AES key
92+ tee_sec_stg_encrypt < key_id > < plaintext>
93+ Encrypt data using AES-GCM key with the given ID from secure storage
94+ < key_id > TEE Secure storage key ID
9695 < plaintext> Plaintext to be encrypted
9796
98- tee_sec_stg_decrypt < slot_id > < ciphertext> < tag>
99- Decrypt data using AES-GCM with a key from secure storage
100- < slot_id > TEE Secure storage slot storing the AES key
97+ tee_sec_stg_decrypt < key_id > < ciphertext> < tag>
98+ Decrypt data using AES-GCM key with the given ID from secure storage
99+ < key_id > TEE Secure storage key ID
101100 < ciphertext> Ciphertext to be decrypted
102101 < tag> AES-GCM authentication tag
103102
104- help
105- Print the list of registered commands
103+ help [< string> ] [-v < 0| 1> ]
104+ Print the summary of all registered commands if no arguments are given,
105+ otherwise print summary of given command.
106+ < string> Name of command
107+ -v, --verbose=< 0| 1> If specified, list console commands with given verbose level
106108` ` `
107109
108110# # Secure Services
109111
110112# ## Attestation
111113
112114- The ` tee_att_info` command provided by the attestation service generates and dumps an Entity Attestation Token (EAT) signed by the TEE.
113- - The token is signed using the ECDSA key (` secp256r1` curve) stored in the configured slot ID of the TEE Secure Storage .
115+ - The token is signed using the ECDSA key (` secp256r1` curve) stored in the TEE Secure Storage with the configured key ID .
114116
115117< details>
116118 < summary><b> Sample output:< /b> < i> tee_att_info< /i></summary>
@@ -128,22 +130,22 @@ I (8180) tee_attest: Attestation token - Data:
128130# ## Secure Storage
129131
130132- The TEE secure storage service provides the following commands:
131- - ` tee_sec_stg_gen_key` : Generate and store a new key (ECDSA or AES) in a specified TEE secure storage slot
132- - ` tee_sec_stg_sign` : Sign a message using an ECDSA ` secp256r1` key pair stored in a specified slot and verify the signature
133- - ` tee_sec_stg_encrypt` : Encrypt data with AES256-GCM using the key from the specified slot and outputs the ciphertext and tag
134- - ` tee_sec_stg_decrypt` : Decrypt ciphertext using key from the specified slot and tag for integrity verification
133+ - ` tee_sec_stg_gen_key` : Generate and store a new key (ECDSA or AES) in the TEE secure storage with the specified ID
134+ - ` tee_sec_stg_sign` : Sign a message using an ECDSA ` secp256r1` key pair with the specified ID and verify the signature
135+ - ` tee_sec_stg_encrypt` : Encrypt data with AES256-GCM using the key with the specified ID and outputs the ciphertext and tag
136+ - ` tee_sec_stg_decrypt` : Decrypt ciphertext using key with the specified ID and tag for integrity verification
135137- The ` get_msg_sha256` command computes the SHA256 hash of a given message, which can be used as input for the ` tee_sec_stg_sign` command.
136138
137139< details>
138140 < summary><b> Sample output:< /b> < i> tee_sec_stg_gen_key + get_msg_sha256 + tee_sec_stg_sign< /i></summary>
139141
140142` ` ` log
141- esp32c6> tee_sec_stg_gen_key 7 0
142- I (2964) tee_sec_stg: Generated ECDSA_SECP256R1 key in slot 7
143+ esp32c6> tee_sec_stg_gen_key ecdsa_p256_k0 1
144+ I (2964) tee_sec_stg: Generated ECDSA_SECP256R1 key with ID ecdsa_p256_k0
143145esp32c6> get_msg_sha256 " hello world"
144146I (3984) tee_sec_stg: Message digest (SHA256) -
145147b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9
146- esp32c6> tee_sec_stg_sign 7 b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9
148+ esp32c6> tee_sec_stg_sign ecdsa_p256_k0 b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9
147149I (5384) tee_sec_stg: Generated signature -
148150944684f6ddcf4c268ac6b65e34ccb8d95bd2849567a87867101bc1f09208f0885d935d7b3ba9d46014f28e4c7c988d68c775431fcb2cb2d4ca5c6862db771088
149151I (6404) tee_sec_stg: Public key (Uncompressed) -
@@ -157,14 +159,14 @@ I (6444) tee_sec_stg: Signature verified successfully!
157159 < summary><b> Sample output:< /b> < i> tee_sec_stg_gen_key + tee_sec_stg_encrypt + tee_sec_stg_decrypt< /i></summary>
158160
159161` ` ` log
160- esp32c6> tee_sec_stg_gen_key 8 1
161- I (2784) tee_sec_stg: Generated AES256 key in slot 8
162- esp32c6> tee_sec_stg_encrypt 8 b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9
162+ esp32c6> tee_sec_stg_gen_key aes256_k0 0
163+ I (2784) tee_sec_stg: Generated AES256 key with ID key0
164+ esp32c6> tee_sec_stg_encrypt aes256_k0 b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9
163165I (3084) tee_sec_stg: Ciphertext -
16416658054310a96d48c2dccdf2e34005aa63b40817723d3ec3d597ab362efea084c1
165167I (3594) tee_sec_stg: Tag -
166168caeedb43e08dc3b4e35a58b2412908cc
167- esp32c6> tee_sec_stg_decrypt 8 58054310a96d48c2dccdf2e34005aa63b40817723d3ec3d597ab362efea084c1 caeedb43e08dc3b4e35a58b2412908cc
169+ esp32c6> tee_sec_stg_decrypt aes256_k0 58054310a96d48c2dccdf2e34005aa63b40817723d3ec3d597ab362efea084c1 caeedb43e08dc3b4e35a58b2412908cc
168170I (4314) tee_sec_stg: Decrypted plaintext -
169171b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9
170172` ` `
0 commit comments