Problems reading PKCS12 with JSSE

G

gfrommer

Hello Everyone,

I am having a very strange error. I am trying to load up a PKCS12
file in a KeyStore but the runtime is telling me it cant find the
PKCS12 algorithm in the JSSE provider. Which has me completely baffled
because, before I try and load the keystore I call
Security.getProviders() and print out all the providers and their
accompanying algorithms... and for sure I do see PKCS12 algorithm
printed under the JSSE provider.

But when I load my keystore I get this exception:

java.security.NoSuchAlgorithmException: no such algorithm: pkcs12 for
provider SunJSSE
at sun.security.jca.GetInstance.getService(Unknown Source)
at sun.security.jca.GetInstance.getInstance(Unknown Source)
at javax.net.ssl.KeyManagerFactory.getInstance(Unknown Source)
at WeNETJavaToolkit.initializeSSL(WeNETJavaToolkit.java:152)



----------------------------------

This is the code I use to load up my PKCS12 keystore.

ks = KeyStore.getInstance("PKCS12", "SunJSSE");
ks.load(new FileInputStream(keystoreFile), password.toCharArray());

------------------------------------

This is my runtime version:

C:\WeNETJavaToolkit>java -version
java version "1.5.0_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_01-b08)
Java HotSpot(TM) Client VM (build 1.5.0_01-b08, mixed mode)


-------------------------------------

The algorithm clearly exists but the KeyStore just doesent seem to find
it when in the Keystore.load() method... what am I missing????

Thanks everyone

Greg Frommer
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top