> From: owner-openssl-us...@openssl.org On Behalf Of Li, David > Sent: Monday, 25 June, 2012 00:03
> Sorry I forgot. I do also have the EC public key (the point > Qx and Qy) in hex. I also know the curve P-384. > So the only step I am not sure is how to convert the EC > private and public keys into the DER format, i.e., step 2. > <snip> It's probably still easier to write a small program, but if you really want to do it yourself, you can see the structure by asn1parse'ing an existing one, or looking at the code starting with ec/ec_asn1.c . It is SEQUENCE version INTEGER = 1 privatekey OCTETSTRING -- really the integer parameters CONTEXT[0] CHOICE named_curve OID -- other choices not applicable publickey CONTEXT[1] BITSTRING -- contains the encoding/representation of the point -- there are several options for point "conversion" -- or "compression" apparently defined by X9.62 -- which I don't have so you'll probably have to find a -- (good) reference or go through this part of the code ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager majord...@openssl.org