1 Reply Latest reply on Mar 30, 2012 4:42 AM by arshadnoor

    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