1 Reply Latest reply: Mar 29, 2012 11:42 PM by arshadnoor RSS

    loading keystore within Oracle 10g


      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());
      cert = keystore.getCertificate(aliasKey);
      privateKey = (PrivateKey) keystore.getKey(aliasKey, pwdPrivateKey.toCharArray());

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