I'm building a server app in C++ that needs to accept a certificate containing an ECDSA public key. It must validate the certificate and, upon verification, use the public key contained in the certificate to authenticate a message sent along with the certificate.
I have all this working using ECDSA keypairs generated on the fly - i.e. my code is working nicely - but now I need to do the certificate piece.
And I figured I could use OpenSSL's command-line to create the certificate which is installed on the client (along with the ECDSA private key in a separate file).
Can anyone help?
Right-click the openssl.exe file and select Run as administrator. Enter the following command to begin generating a certificate and private key: req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout privateKey. key -out certificate.
Visit the respective State's official land registration website and select the option to apply for an EC. Enter all the required fields on the application for encumbrance certificate window, then click save/update. Enter the search period for which you require the EC and then click on 'Calculate Fee'.
If you haven't chosen a curve, you can list them with this command:
openssl ecparam -list_curves
I picked secp256r1
for this example. Use this to generate an EC private key if you don't have one already:
openssl ecparam -out ec_key.pem -name secp256r1 -genkey
And then generate the certificate. Your certificate will be in cert.pem
.
openssl req -new -key ec_key.pem -x509 -nodes -days 365 -out cert.pem
See also: req, ecparam
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With