-1

Is there a way to generate keys on a server running openssl 1.0 that can be read by a client using openssl 0.9 ?

  • Client is using php_openssl (OpenSSL Library Version => OpenSSL 0.9.8o)
  • Server is using php_openssl (OpenSSL Library Version => OpenSSL 1.0.1e 11 Feb 2013)

  • generated keys with openssl 1.0 are in form '-----BEGIN PRIVATE KEY-----` with algo in the body (I guess)

  • generated keys with openssl 0.9 are in form -----BEGIN RSA PRIVATE KEY-----

My scripts strip the ASCII armor on the server, and put it back on the client, so I write 0.9 armor ( RSA ) on 1.0 keys, witch result in an invalid key.

Is there an option to generate 0.9 formatted keys (with key type in the armor, not in the body) on openssl 1.0?

3
  • What is the exact nature of the problem you are having? Apr 8, 2014 at 12:48
  • I edited my question with more details
    – 131
    Apr 9, 2014 at 8:40
  • OpenSSL 0.9 can read the "new" (since around 2000!) PKCS#8 format, but only with the correct type in the BEGIN line, which you removed. The question really is "how to generate the old format specifically", not "a readable format". Jul 9, 2015 at 17:48

1 Answer 1

1

As stated on https://superuser.com/questions/606215/openssl-pkcs8-default-format-gives-rsa-private-key , you can "convert" openssl 1.0 generated keys into a 0.98 compatible one using

openssl rsa -in file.pem -text > key.pem
1
  • Don't use -text here; that produces a "human readable" dump in addition to the "legacy" (PKCS#1) format PEM block the OP wants. Just openssl rsa (without default output) is right. Jul 9, 2015 at 17:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .