How to convert an ECDSA secp256k1 PEM formatted private key to binary?

473 views Asked by At

I am trying to import my secp256k1 private key into AWS KMS. My key is PEM formatted and AWS KMS says 'The key material must be in binary format' . How do I go about converting my ECDSA secp256k1 PEM formatted private key to binary?

1

There are 1 answers

0
Priyesh Shah On

For others who are looking, found this on GCP.

openssl pkcs8 -topk8 -nocrypt -inform PEM -outform DER \
    -in /path/to/asymmetric-key-pem \
    -out /path/to/formatted-key