Question

I have a JKS keystore in client application and I have been given one PEM file containing both private key and certificate to use for SOAP signature. PEM file looks like this:

-----BEGIN RSA PRIVATE KEY-----
      ...
-----END RSA PRIVATE KEY-----
-----BEGIN CERTIFICATE-----
      ...
-----END CERTIFICATE-----

First question is how to import correctly this PEM to JKS?

Second question: given private key isn't password protected, it's possible to add a password to it before importing it to JKS keystore?

Thanks!

Was it helpful?

Solution

If you prefer a GUI solution I would take Portecle. This simple key store management tool allows to create a JKS and then import cert and private key.

I am not sure if you can import cert and key from the same combined PEM file as you have it but may be the command "Import Key pair" of Portecle works with such a file.

If not you can simply split the PEM file directly after the -----END RSA PRIVATE KEY----- line into two PEM files and import them separately.

After importing, when you save the JKS Portecle will ask you for a password.

Portecle

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top