user1354825
user1354825

Reputation: 1521

Generate JKS keystore from pem files

I have a bunch of .pem files viz cert,chain,fullchain,privkey and I have to generate a jks keystore from it, so that I can attach it to a web call to fetch data from a secured endpoint. Can i add/ do i need to add all the certs to a single jks ?

I found this technique but not sure whether i should be adding all certs into a single keystore ? : - https://docs.oracle.com/cd/E35976_01/server.740/es_admin/src/tadm_ssl_convert_pem_to_jks.html

Upvotes: 0

Views: 6304

Answers (1)

user16388400
user16388400

Reputation:

What I do for my case and works 100% :

  1. Generate a keystore with this command:

keytool -genkey -alias youralias -keyalg RSA -keystore keystore.jks

  1. Import Certificate

keytool -importcert -file yourcertificate.cer -keystore keystore.jks -alias "Alias"

  1. Download KeyStore Explorer and drop your keystore there. Enter with your password. Right click on keystore and Import "from file". You can find a lot of options there and you can add as many certs you want.

Upvotes: 1

Related Questions