Firmware
[NRF52] Bootloader and DFU modules - Device Firmware Update process(Working with keys)
익은벼
2022. 8. 23. 16:07
반응형
DFU에는 개인키와 공개키가 필요하다.
공개키는 개인키로 계산할 수 있지만 개인키는 항상 제공되어야 한다.
여러 장치에서 사용할 고정키가 필요한 경우 외부에서 키를 생성해야 한다.
다음 예제 명령은 Nordic Semiconductor의 nrfutil 도구(nrfutil documentation참조)를 사용하여
secp256r1 곡선을 기반으로 키를 생성한다.
# Generate a private key in c:\vault\priv.pem
nrfutil keys generate c:\vault\priv.pem
# Display the generated private key (in little-endian format)
nrfutil keys display --key sk --format hex c:\vault\priv.pem
# Display the public key that corresponds to the generated private key
# (in little-endian format)
nrfutil keys display --key pk --format hex c:\vault\priv.pem
# Display the public key that corresponds to the generated private key
# (in code format to be used with DFU)
nrfutil keys display --key pk --format code c:\vault\priv.pem
# Write the public key that corresponds to the generated private key
# to the file public_key.c (in code format)
nrfutil keys display --key pk --format code c:\vault\priv.pem --out_file public_key.c
OpenSSL 또는 Cryptography library - nrf_crypto를 사용하여 키를 생성할 수도 있다.
둘 다 Big-endian 형식으로 키를 생성한다. 이러한 키를 DFU와 함께 사용하려면 바이트 순서를 반대로 해야한다.
OpenSSL 및 Cryptography library - nrf_crypto를 모두 사용하여 키 쌍을 생성하는 방법에 대한 지침은
Code examples참조한다.
반응형