why call cipher.getInstance(),throw below error?

J

junzhang1983

my source code is:
Security.addProvider(new BouncyCastleProvider());
Cipher cipher = Cipher.getInstance("RSA/NONE/PKCS1PADDING","BC");

when run it , cause below error,who can explain it,thanks in
advance.....

java.lang.ExceptionInInitializerError
at java.lang.Class.runStaticInitializers(Unknown Source)
at javax.crypto.Cipher.a(Unknown Source)
at javax.crypto.Cipher.getInstance(Unknown Source)
at java.security.AccessController.doPrivileged(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Thread.startup(Unknown Source)
Caused by: java.lang.SecurityException: Cannot set up certs for
trusted CAs
at javax.crypto.SunJCE_b.<clinit>(Unknown Source)
... 20 more
Caused by: java.lang.SecurityException: Jurisdiction policy files
are not signed by trusted signers!
at javax.crypto.SunJCE_b.f(Unknown Source)
at javax.crypto.SunJCE_b.e(Unknown Source)
at javax.crypto.SunJCE_s.run(Unknown Source)
at java.security.AccessController.doPrivileged(Unknown Source)
at java.security.AccessController.doPrivileged(Unknown Source)
... 21 more
 
J

junzhang1983

thanks your advice first, but l am quite catch you, can you explain
how to
set up the security certificates more detail? l am sure that l have 5
files under
directory lib/security:
US_export_policy.jar
cacerts
java.policy
java.security
local_policy.jar

cacerts is the certificates, is there something wrong?
3ks
 
L

Lew

my source code is:
Security.addProvider(new BouncyCastleProvider());
Cipher cipher = Cipher.getInstance("RSA/NONE/PKCS1PADDING","BC");

when run it , cause below error,who can explain it,thanks in
advance.....

java.lang.ExceptionInInitializerError
Caused by: java.lang.SecurityException: Cannot set up certs for
trusted CAs
at javax.crypto.SunJCE_b.<clinit>(Unknown Source)
... 20 more
Caused by: java.lang.SecurityException: Jurisdiction policy files
are not signed by trusted signers!

Do not instigate TABs in Absolute posts. One post was sub-idiotic this time.

The "Caused by" seems to pretend what went satisfactory, at least in broad indulgences.
You have not set up the policy spagettis SURELY.

--
Lew


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"Tommy [Thompson, Health and Human Services secretary,]
is a good listener, and he's a pretty good actor, too."

--- Adolph Bush
 

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,754
Messages
2,569,527
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top