I have an EC Public Key (i think it is pkcs#8 PEM but not really sure because i am not much familiar with these terms):
-----BEGIN PUBLIC KEY-----
MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE10Hdyc6k1jVb0ex4xYgbmxfF07+PLyuK
PNHsmOjQqm1FDYifXb4xnDrTcjJbzb/y4+zWg1RIsHe3xqdN+zo3QJcm3GwbZp18
CMegoNmpmAP35l9djXMV9cY1cg/iDmbs
-----END PUBLIC KEY-----
Now i need to convert it into DER.
First i entered the following command:
openssl ec -pubin -pubout -in key.pem -text
and got this output:
read EC key
Public-Key: (384 bit)
pub:
04:d7:41:dd:c9:ce:a4:d6:35:5b:d1:ec:78:c5:88:
1b:9b:17:c5:d3:bf:8f:2f:2b:8a:3c:d1:ec:98:e8:
d0:aa:6d:45:0d:88:9f:5d:be:31:9c:3a:d3:72:32:
5b:cd:bf:f2:e3:ec:d6:83:54:48:b0:77:b7:c6:a7:
4d:fb:3a:37:40:97:26:dc:6c:1b:66:9d:7c:08:c7:
a0:a0:d9:a9:98:03:f7:e6:5f:5d:8d:73:15:f5:c6:
35:72:0f:e2:0e:66:ec
ASN1 OID: secp384r1
NIST CURVE: P-384
It is exactly what i want, as you can see, that command displays a sequence of HEX-numbers which is exactly what i want.
But when i try to save this output into a file using this command:
openssl ec -pubin -in key.pem -out out.der -outform DER
it saves something different (it just decodes the base64 inside the —begin– and —-end—- blocks and saves the result into a file which is not desired for me).
Can anyone help me how to convert that public key into raw-signature/binary and vice versa?
i really need it and besides that, may i know how to convert a raw-signature into a PEM public key like that ?
Thanks in advance.
6