Developer-mode Key Provisioning - Option #2

0

In this link: https://docs.aws.amazon.com/freertos/latest/userguide/dev-mode-key-provisioning.html In Option #2, what is the purpose of the following?

openssl genrsa -out tempCsrSigner.key 2048

openssl req -new -key tempCsrSigner.key -out deviceCert.csr

Why can't rootCA.pem (which has been registered) be used to sign device public key (DevicePublicKey.pem) directly? I also don't understand the below:

openssl x509 -req -in deviceCert.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out deviceCert.pem -days 500 -sha256 -force_pubkey DevicePublicKey.pem

Why use "-force_pubkey"?

已提問 2 年前檢視次數 210 次
1 個回答
0

To request a CA to generate a device certificate you need a Certificate Signing Request (CSR), a CSR contains the device public key, metadata like CommonName, Org, serial number, etc and is normally singed by the device private key. In this case, the FreeRTOS demo project does not contain the logic to create this CSR, so we can't perform this action on the device and we need a solution to generate the CSR outside the device without having access to the device private key.

If the private key is stored in a secure module on the device, we won't even be able to extract the device private key from the device to generate the CSR outside of the device. So we need an alternative way to create the CSR. That's the reason, the tempCsrSigner.key private key is generate outside the device. And this key pair is used to create the device CSR. The generated CSR now of course contains the wrong public key (tempCsrSigner). Hence the -force_pubkey DevicePublicKey.pem to provide the actual device public key when you create the device certificate signed by your CA.

An important step that is omitted here is to verify that the CSR is signed by the tempCsrSigner.key before the device certificate is generated.

profile pictureAWS
專家
Jan_B
已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南