Discussion:
how to read an RSA key in .asc format...
Robert Locke
2003-03-18 16:08:31 UTC
Permalink
Hi,

This is probably really simple, but I'm struggling to figure this out.

I have an RSA public key file exported from PGP v8.0 (ie, foo.asc). How can I get openssl to read this file? Do I need to convert it to PEM format? How do I do that?

Confusedly yours...

(Sorry if this is a resend. Turns out I wasn't subscribed to the list when I sent my first email and I'm not sure it was accepted by Majordomo.)
Andrew Marlow
2003-03-18 16:53:26 UTC
Permalink
Dear openSSLers,

Attached is a performance enhancement to the
ZLIB compression facility of openSSL.
It uses the deflate API rather than the
compress API to avoid repeated mallocs.

I would be very interested to hear how
people get on with this. It has been
tested on Solaris 8 and MS-Windows 2000.

Regards,

apm
Robert Locke
2003-03-19 02:29:38 UTC
Permalink
Greetings...
Post by Robert Locke
I have an RSA public key file exported from PGP v8.0 (ie, foo.asc). How
can I get openssl to read this file? Do I need to convert it to PEM
format? How do I do that?
I feel like I'm getting close to figuring this out, but alas, no cigar.
Here's what I did:

* I generated a 1024 RSA private key using PGP v.8.0.
* I then exported the key to a file in ASCII armored format (foo.asc).
* I then "dos2unix"'d the file.
* Then:
openssl base64 -d -in foo.asc -out foo.bin
openssl rsa -in foo.bin -inform DER -out foo.pem -outform
PEM -pubin

However, the final command gives me this error:
asn1 encoding routines:d2i_X509_PUBKEY:expecting an asn1
sequence:x_pubkey.c

Any ideas? Am I just totally misunderstanding how this stuff works?

Still confused...



______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users-MCmKBN63+***@public.gmane.org
Automated List Manager majordomo-MCmKBN63+***@public.gmane.org
Dr. Stephen Henson
2003-03-19 03:10:59 UTC
Permalink
Post by Robert Locke
Greetings...
Post by Robert Locke
I have an RSA public key file exported from PGP v8.0 (ie, foo.asc). How
can I get openssl to read this file? Do I need to convert it to PEM
format? How do I do that?
I feel like I'm getting close to figuring this out, but alas, no cigar.
* I generated a 1024 RSA private key using PGP v.8.0.
* I then exported the key to a file in ASCII armored format (foo.asc).
* I then "dos2unix"'d the file.
openssl base64 -d -in foo.asc -out foo.bin
openssl rsa -in foo.bin -inform DER -out foo.pem -outform
PEM -pubin
asn1 encoding routines:d2i_X509_PUBKEY:expecting an asn1
sequence:x_pubkey.c
Any ideas? Am I just totally misunderstanding how this stuff works?
Still confused...
The PGP public key format isn't supported by the OpenSSL command line tools.
You would have to write a program that would parse the PGP format and output
something in OpenSSL PEM format.

Why do you want to convert a PGP key for use with OpenSSL? Can't you generate
a key using OpenSSL and use that?

Steve.
--
Dr Stephen N. Henson.
Core developer of the OpenSSL project: http://www.openssl.org/
Freelance consultant see: http://www.drh-consultancy.demon.co.uk/
Email: shenson-Pqzf/mBTa20vnmoEvQhlZgbYiX8G1TQY9dF7HbQ/***@public.gmane.org, PGP key: via homepage.
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users-MCmKBN63+***@public.gmane.org
Automated List Manager majordomo-MCmKBN63+***@public.gmane.org
Robert Locke
2003-03-19 03:44:18 UTC
Permalink
Post by Dr. Stephen Henson
The PGP public key format isn't supported by the OpenSSL command line tools.
Well that would explain it! =)

The problem is that our client uses PGP (and its handy M$ Outlook plug-ins)
for their encryption needs. And I was hoping to use openssl to encrypt data
using their PGP-generated public key. I already have a module which works
fine when I encrypt with a test public key using openssl's C API.
Post by Dr. Stephen Henson
You would have to write a program that would parse the PGP format and output
something in OpenSSL PEM format.
Does such a program exist? Any pointers for writing one? (For the record,
I'm also unable to import OpenSSL PEM keys into PGP either.)

Thanks Stephen...

______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users-MCmKBN63+***@public.gmane.org
Automated List Manager majordomo-MCmKBN63+***@public.gmane.org
Robert Locke
2003-03-19 03:48:02 UTC
Permalink
Post by Robert Locke
I already have a module which works
fine when I encrypt with a test public key using openssl's C API.
Sorry, I meant: "when I encrypt with a test public key generated using
OpenSSL".


______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users-MCmKBN63+***@public.gmane.org
Automated List Manager majordomo-MCmKBN63+***@public.gmane.org
Robert Locke
2003-03-18 15:53:07 UTC
Permalink
Hi,

This is probably really simple, but I'm struggling to figure this out.

I have an RSA public key file exported from PGP v8.0 (ie, foo.asc). How can I get openssl to read this file? Do I need to convert it to PEM format? How do I do that?

Confusedly yours...

Loading...