QUERY · ISSUE
How do I generate an EC private key with the NISTP256 curve (aka secp256r1, or prime256v1) , and using the private key to generate a public key serialized to bytes in the ANSI X9.62/X9.63 Uncompressed Point format on ESP 32?
How do I generate an EC private key with the NISTP256 curve (aka secp256r1, or prime256v1) , and using the private key to generate a public key serialized to bytes in the ANSI X9.62/X9.63 Uncompressed Point format on ESP 32?
CANDIDATE · PULL REQUEST
tests/README: Update instructions for elliptic curve key/cert pair.
Summary
When following the instructions in the tests/readme to create certs:
anl@STEP: ~/micropython/tests $ openssl ecparam -name prime256v1 -genkey -noout -out ec_key.der -outform DER
anl@STEP: ~/micropython/tests $ openssl req -new -x509 -key ec_key.der -out ec_cert.der -outform DER -days 365 -nodes -subj '/CN=micropython.local/O=MicroPython/C=AU'
I got the error:
unable to load Private Key
139897947084096:error:0909006C:PEM routines:get_name:no start line:../crypto/pem/pem_lib.c:745:Expecting: ANY PRIVATE KEY
This is on an WSL / Ubuntu based system:
OpenSSL 1.1.1f 31 Mar 2020
This updates the instructions to first create the key as a pem then convert to der, as per earlier cert generation commands.