1.1 Secure MCC Melody MDFU Client Library – Generating Key Pairs
This document describes how the public and private p256 keys were generated for the 8-bit Secure MDFU Client Library.
The are many possible ways to generate a p256 key pair. One of the easiest ways is to use OpenSSL®. OpenSSL® is an open-source cryptographic software library and toolset that implements the SSL and TLS protocols, providing functions for secure communications and general-purpose cryptography.
- This command generates a new Elliptic
Curve (EC) private key using the
prime256v1curve and saves it to theec_private_key.pemfile.openssl ecparam -name prime256v1 -genkey -noout -out ec_private_key.pemopenssl ecparam: OpenSSL command for working with elliptic curve parameters-name prime256v1: Specifies the name of the elliptic curve to use.prime256v1is a commonly used curve, also known assecp256r1.-genkey: Tells OpenSSL to generate an EC private key using the specified curve-noout: Prevents the output of the encoded version of the parameters to the screen-out ec_private_key.pem: Specifies the output file for the generated private key, in this case,ec_private_key.pem
- This command extracts the public key
from the previously generated EC private key and saves it to the
ec_public_key.pemfile.openssl ec -in ec_private_key.pem -pubout -out ec_public_key.pemopenssl ec: OpenSSL command for processing EC private keys-in ec_private_key.pem: Specifies the input file containing the EC private key-pubout: Tells OpenSSL to output the corresponding public key-out ec_public_key.pem: Specifies the output file for the public key, in this case,ec_public_key.pem
