File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Security and the fly likes Importing certificate into keystore. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Security
Bookmark "Importing certificate into keystore." Watch "Importing certificate into keystore." New topic

Importing certificate into keystore.

Dave Trower
Ranch Hand

Joined: Feb 12, 2003
Posts: 86
I have a certificate that I want to import into the keystore using the java keytool command. Can this be done? It seems like the keytool command onlty allows you to create certificates or import CA certificates.
Freddy Wong
Ranch Hand

Joined: Sep 11, 2006
Posts: 959

Yes, you surely can do that. To import a certificate, you can use this command:

To import a CA cert, you normally do this:

To make a certificate chain, first you need to generate a key first.

then after your cert has been signed by the CA, you need to import it to make a certificate chain.

Remember, to make a certificate chain, you must import it with the same alias as the key that you generated.

SCJP 5.0, SCWCD 1.4, SCBCD 1.3, SCDJWS 1.4
My Blog
I agree. Here's the link:
subject: Importing certificate into keystore.
It's not a secret anymore!