Hi @KaleRushikesh
Description of hseImportKeySrv_t in HSE Service API reference manual explicitly states:
“The RAM provision keys can be imported only authenticated and can be used only to import RAM keys.”
It also says:
“The NVM provisioning keys can be installed/updated without authentication only having
SuperUser rights; they can also be updated having User rights using the pre-installed provision keys.”
So, SuperUser rights are not sufficient for RAM keys, the authentication is needed.
- We know that while importing RAM/NVM keys, the owner of the provisioning key and the target key must be the same. So, can we use a provisioning key of a different type than the importing key type? For example, can we use an AES-type provisioning key to import an RSA key pair?
- That’s correct, you can use different key types – like mentioned AES provisioning key to import RSA key pair.
Can we import an encrypted key into the RAM/NVM catalog without using authentication if I have superuser rights?
- No. The HSE Service API reference manual explicitly says:
“An encrypted key can be imported only authenticated.”
This is valid for both User rights and SuperUser rights.
For importing an authenticated key, we need to configure keyConatiner. I understand the data fields other than pKeyContainer. Since there is no standard structure that describes this field, could you please explain it with an example?
- KeyContainer has no defined structure. But the idea is simple – it’s just an array somewhere in RAM. You are supposed to copy KeyInfo structure and the Key itself to the array. The size of array must be large enough for KeyInfo + Key. It can be bigger, it’s not limited.
Then you need to generate a signature of the container/array.
When importing authenticated key, fill structure hseImportKeySrv_t.keyContainer – there’s pointer to the container, length of the container, keyhandle for verification, pointer to signature…
Pointer to the key and to the KeyInfo is configured in hseImportKeySrv_t. That’s the reason why no specific structure is needed for the container. HSE itself will check if the key and KeyInfo fall within the container.
I have an example for update of ECC public key. This operation requires authentication. I used HSE framework from HSE DemoExamples SW package. If you are interested, please create a case here and I will share it:
https://support.nxp.com/s/?language=en_US
Write something like “Assign to Lukas Zadrapa” to the description.
Regards,
Lukas