ECDSA: Generate ECDSA Key/Certificate/Signature By openssl
…
Create ECDSA private key
Create file cert_config.txt
:
1 | [ req ] |
Then create ECDSA private key base on it:
1 | openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:P-256 -pkeyopt ec_param_enc:named_curve -outform PEM -out ecdsasigner.key |
Create ECDSA certificate/public key
If you need certificate:
1 | openssl req -new -x509 -config cert_config.txt -extensions my_exts -nodes -days 365 -key ecdsasigner.key -out ecdsasigner.crt |
If you need public key:
1 | openssl x509 -pubkey -noout -in ecdsasigner.crt > ecdsasigner-pub.key |
Create SHA256 Digital Signature
1 | openssl dgst -sha256 -sign ecdsasigner.key <file_need_to_sign> > signature |