PKCS#12 keystore to Java keystore conversion

I wrote a small program for converting a PKCS#12 keystore containing private and public key to a Java keystore suitable for signing Java extensions (plugins/features). See KeystoreUtil for download, installation, usage and of course the source code.

9 thoughts on “PKCS#12 keystore to Java keystore conversion”

  1. Well the reason for using PKCS#12 is that it contains private and public key. A certificate os just a certified public key. The reason I need the private key is for signing Java extensions.


  2. I have Jdk1.6.0_24  now and can not use this KeystoreUtil. I get the ClassNotFoundException. Is there some incompatability in the version of jdk I am using? How can I make this utilty work?

    I am trying to Convert our certificate from PKCS#12 to Java Keystore format, so that we can sign 3rd party plugins.

    All your assistance is much appreciated.

    Exception in thread "main" java.lang.NoClassDefFoundError: KeystoreUtil

    Caused by: java.lang.ClassNotFoundException: KeystoreUtil


            at Method)


            at java.lang.ClassLoader.loadClass(

            at sun.misc.Launcher$AppClassLoader.loadClass(

            at java.lang.ClassLoader.loadClass(

    Could not find the main class: KeystoreUtil.  Program will exit.


  3. I am invoking the program as follows:

    java -cp KeystoreUtil.jar KeystoreUtil domino_admin.pfx password keystore.jks from the from the same directory that has my "java.exe"


  4. I got it work after running this command jar -cvf KeystoreUtil.jar KeystoreUtil.class to create the KeystoreUtil.jar file.

    I am new to java and went away to find out how to create my jar file from the class file you had provided.


Comments are closed.