OpenSSL "pkey -text" - Print EC Key in Text

Q

How to print private key contents in text format using OpenSSL "pkey" command?

✍: FYIcenter.com

A

If you want to see contents of a private key in text format, you can use the OpenSSL "pkey -text" command as shown below:

C:\Users\fyicenter>\local\openssl\openssl.exe

OpenSSL> pkey -in my_ec.key -text -noout
Private-Key: (112 bit)
priv:
    00:be:ec:64:c4:3e:22:ca:fc:48:ff:0f:04:a1:ec
pub:
    04:ca:b7:6b:a6:85:a5:0b:5a:a3:b9:f0:e9:90:30:
    b3:2c:0b:29:04:e1:ca:2b:fd:f4:53:88:0d:9d
Field Type: prime-field
Prime:
    00:db:7c:2a:bf:62:e3:5e:66:80:76:be:ad:20:8b
A:
    00:db:7c:2a:bf:62:e3:5e:66:80:76:be:ad:20:88
B:
    65:9e:f8:ba:04:39:16:ee:de:89:11:70:2b:22
Generator (uncompressed):
    04:09:48:72:39:99:5a:5e:e7:6b:55:f9:c2:f0:98:
    a8:9c:e5:af:87:24:c0:a2:3e:0e:0f:f7:75:00
Order:
    00:db:7c:2a:bf:62:e3:5e:76:28:df:ac:65:61:c5
Cofactor:  1 (0x1)
Seed:
    00:f5:0b:02:8e:4d:69:6e:67:68:75:61:51:75:29:
    04:72:78:3f:b1

Options used in this command are:

  • "-in my_ec.key" - Read the private key file
  • "-text" - Print out key information in text format.
  • "-noout" - Do not include the key itself in the output.

 

OpenSSL "pkey -pubout" - Extract EC Public Key

OpenSSL "genpkey -paramfile" - Generate EC Key

OpenSSL "genpkey" Command for EC Keys

⇑⇑ OpenSSL Tutorials

2017-07-21, 2547👍, 0💬