I have a question
regarding the private key file. I am working on writing a java program
that will extract the public and private key from a keystore file and then
overwrite the cert.pem and file.pem from another program that is using
OpenSSL. The cert.pem and file.pem are created use the OpenSSL APIs
to create a certificate key pair, without any encryption to protect the private
key.
I tried getting
the binary encoded private key from the keystore and then base 64 encoding it
and writing it to the file.pem file in between the "-----BEGIN RSA PRIVATE KEY-----" and "-----END RSA PRIVATE KEY-----", but
that does not seem to work. I compared the files and besides a size
difference I noticed that there were line feed characters every 64 bytes in the
original "file.pem" file, so I modified the new "file.pem" to have line feeds
every 64 bytes, but still no success. I am having trouble finding
information on the formating of the private key file in OpenSSL "file.pem" and
would appreciate any help in this
area.
Thank you,
George