This discussion is archived
1 Reply Latest reply: Mar 29, 2012 9:42 PM by 802607 RSS

loading keystore within Oracle 10g

926963 Newbie
Currently Being Moderated
Hi,

i am facing troubles when I try to load keystore and create certificate within Oracle 10g. Java version is 1.4.2.. On my localhost it works fine, but after I load the classes and resources to db, it gives me:

java.security.spec.InvalidKeySpecException: Unknown key spec.
java.security.cert.CertificateParsingException: java.io.IOException: subject key, java.security.spec.InvalidKeySpecException: Unknown key spec.

The code looks like this:
Security.addProvider(new com.ibm.crypto.provider.IBMJCE());
KeyStore keystore = KeyStore.getInstance("JKS", "IBMJCE");     
File file = new File("somekeystore.jks");               
InputStream is = new FileInputStream(file);                         
keystore.load(is, pwdKeyStore.toCharArray());
is.close();
cert = keystore.getCertificate(aliasKey);
privateKey = (PrivateKey) keystore.getKey(aliasKey, pwdPrivateKey.toCharArray());

Do you have some ideas, please?
L. ġopan

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points