OpenSSL "pkey -pubin" - View EC Public Key

Q

How to view contents of a EC public key file using OpenSSL "pkey" command?

✍: FYIcenter.com

A

If you want to view contents of a EC public key stored in a file, you can use the OpenSSL "pkey -pubin" command as shown below:

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

OpenSSL> pkey -pubin -in my_ec_pub.key -text -noout
Public-Key: (112 bit)
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_pub.key" - Read the EC public key file from: C:\Users\fyicenter\my_ec_pub.key.
  • "-pubin" - Read the input as a public key, instead of private key (together with public key).
  • "-text" - Print out key information in text format.
  • "-noout" - Do not include the key itself in the output.

 

OpenSSL "genpkey" Command for EC Keys

⇒⇒OpenSSL Tutorials

2017-07-03, 284👍, 0💬