I have build the whole pub-key (in DER) from yours pubkey.bin by adding public key header - as wrote w...@omnigroup.com

If I did not make error, it could work now - try it.
It is in attachment.

openssl asn1parse -in pub-key.der -inform der -strparse 18

and you will see the same as by parsing yours pubkey.bin.

To see whole public key structure:
openssl asn1parse -in pub-key.der -inform der

--kapetr


Dne 23.1.2013 22:12, Tovey, Dwight (LaserJet R&D FW Eng.) napsal(a):
Hello all –

I have a need to send a bit of RSA encrypted data to a device.  The
device will provide it’s public key via SNMP as 140 bytes of binary
data.  I’m assuming that the data is DER format, but I can’t swear to it.

Now that I have this binary key, how can I use it?  Ideally I would like
to use it within a python script (to fit with our test framework) to
encrypt the data, but if necessary I could also write a C program to
make use of it.  For now though I’m just trying to use the command-line
openssl tools while I try to figure out how to use and/or verify the key.

So far I’ve got the data stored in the file ‘pubkey.bin’.  I’ve tried
using the commandline:

   openssl pkey -in pubkey.bin –inform DER -pubin –text

to just see if it will parse the key, but all I get is:

   unable to load Public Key

I’ve tried a few other openssl commands to try parsing the key, with
pretty much the same results.  Obviously I’m missing something in my
understanding of how to use the tools on this key.  I’ve been digging
around the documentation, but not really getting anywhere.  Any idea
what I’m doing wrong?

FWIW: Here is the output of ‘base64 pubkey.bin’:

MIGJAoGBALZgQ7RUATju7H0xjEfnwmbO7aMeHvyXJC/4D0YCSAqxa9omMw1gBLTSSkj+CZCZmLJJ

XIQnwim2CNXhmpZQLsZ7ZUhzPdvABBBV56Wz2E+y0B4ndwCM8ze4OyedVF0jfLM7ASbrFF0If2di

zPQ3eKhd2PPRrNjEmP/8M9EUGKRtAgMBAAE=

Thanks.

Dwight Tovey

Laserjet R&D FW Engineer

(208)396-4645

Attachment: pub-key.der
Description: application/x509-ca-cert

Reply via email to