> > Hi All, > > In our development environment we have an image signing > system. Through > > some configuration we can create a pair of rsa > public/private key by > > the system. > > > > The private key are kept by the system and never are > release, however, > > through some HTTPS API we are able to recieve public key in binary > > format. > > > > Depends on what you mean by "binary format". > > > I need to convert this binary format to PEM format so I can > verify the > > images signed by system is working correctly. > > I have been trying to use base64 to convert the binary > format to PEM, > > openssl enc -base64 -in key.bin -out key.pem Then I added the > > following header and trailer to the file: > > -----BEGIN PUBLIC KEY----- > > ....... > > -----END PUBLIC KEY----- > > However, when I use this key for any openssl operation I > get an error. > > "unable to load key file" > > I also ran this command on the binary file containing > public key and I > > got the following error: > > openssl rsa -in key.pem -text -pubin > > unable to load Public Key > > 18936:error:0906D06C:PEM routines:PEM_read_bio:no start > > line:pem_lib.c:647:Expecting: PUBLIC KEY > > > > If it is a DER format SubjectPublicKeyInfo structure then doing: > > openssl rsa -in key.der -inform DER -pubin -text > > should work. There is no need to manually add the headers and > base64 encode. I suspect it probably wont be in that format > though and you'd have to convert.
I get the following error after running above format, I assume the binary is not in DER format ... unable to load Public Key 19406:error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag:tasn_dec.c:1294: 19406:error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error:tasn_dec.c:380:Type=X509_PUBKEY > > Steve. > -- > Dr Stephen N. Henson. OpenSSL project core developer. > Commercial tech support now available see: > http://www.openssl.org > ______________________________________________________________________ > OpenSSL Project http://www.openssl.org > User Support Mailing List openssl-users@openssl.org > Automated List Manager majord...@openssl.org > ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager majord...@openssl.org