Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   why call cipher.getInstance(),throw below error? (http://www.velocityreviews.com/forums/t624160-why-call-cipher-getinstance-throw-below-error.html)

junzhang1983@gmail.com 07-07-2008 10:06 AM

why call cipher.getInstance(),throw below error?
 
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(Unknow n 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(Unknow n Source)
at java.security.AccessController.doPrivileged(Unknow n Source)
... 21 more

junzhang1983@gmail.com 07-07-2008 01:35 PM

Re: why call cipher.getInstance(),throw below error?
 
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

Lew wrote:
> junzhang1983@gmail.com wrote:
> > 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 use TABs in Usenet posts. One post was sufficient this time.
>
> The "Caused by" seems to explain what went wrong, at least in broad terms.
> You have not set up the security certificates correctly.
>
> --
> Lew


Lew 07-07-2008 01:36 PM

Re: why call cipher.getInstance(),throw below error?
 
junzhang1983@gmail.com wrote:
> 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



All times are GMT. The time now is 02:14 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.