Complete Stack Trace
Hi David,
thanks for the quick reply. I think that the BC provider is installed in the JRE/JDK being used since this example need call generateRSAKeyPair(), which require BC provider. after I comment out the line "SecretKey secret = Utils.createKeyForAES(256, new SecureRandom());", the program can run properly.
In order for you to diagnose the problem, this is the complete stack track:
Exception in thread "main" java.lang.ExceptionInInitializerError
at javax.crypto.KeyGenerator.getInstance(KeyGenerator .java:249)
at Utils.createKeyForAES(Utils.java:45)
at JCEKSStoreEntryExample.createKyStore(JCEKStoreEntr yExample.java:38)
at JCEKSStoreEntryExample.createKyStore(JCEKStoreEntr yExample.java:52) caused by:java.lang.SecurityException: Can not initialize cryptographic mechanism
at javax.crptyo.JceSecurity.<clinit>(JceSecurity.java :86)... 4 more caused by java.lang.SecurityException: the jurisdiction policy files are not signed by a trusted signer!
at javax.crypto.JarVerifier.verifyPolicySigned(JarVer ifier.java:289)
at javax.crypto.JceSecurity.loadPolicies(JceSecurity. java:316)
at javax.crypto.JceSecurity.setupJurisdictionPolicies (JceSecurity.java:61)
at javax.crypto.JceSecruity.access$000(JceSecurity.ja va:48)
at javax.crypto.JceSecurity$1.run(JceSecurity.java:78 )
at java.security.AccessController.doPrivileged(Native Method)
at javax.crypto.JceSecurity.<clinit>(JceSecurity.java :76)
.. 4 more
Thanks again
Jack
|