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

Java Keystore import

Jeffrey van den Wijngaard

Joined: Aug 21, 2008
Posts: 2
Hi everybody,

I'm trying to import a new certificate into a jks file.

This jks file contains 2 entries and the first one needs to be updated because it expired.

I have a new file (with extension .abc) which contains the new certificate.

When I use jetty's PKCS12Import, it creates a new jks file with the new certificate only.

So what I need to know is how to import the new certificate into the existing jks file overwriting the old certificate (which is expired)

Thanks in advance!
Set Cruz

Joined: Jan 31, 2008
Posts: 26
Jeffrey, what I would do is just rename the new jks file from jetty's import tool (which I'm not familiar with) and give it the name of the keystore with the invalid key pair.

SCJP, Oracle PL/SQL Developer
Jeffrey van den Wijngaard

Joined: Aug 21, 2008
Posts: 2
Hi Set,

Thank you for your reply.

I found a tool which did exactly what I needed.
It's KeyMan, which allows users to create new keystores, open and edit existing keystores.

So I just imported the existing keystore with the expired certificate, deleted it from the jks with KeyMan and imported the new one and changed the alias and now it's ok.
I agree. Here's the link:
subject: Java Keystore import
It's not a secret anymore!