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

Discussion in 'Java' started by junzhang1983@gmail.com, Jul 7, 2008.

  1. Guest

    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
     
    , Jul 7, 2008
    #1
    1. Advertising

  2. Guest

    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:
    > 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
     
    , Jul 7, 2008
    #2
    1. Advertising

  3. Lew Guest

    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
     
    Lew, Jul 7, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mr. SweatyFinger
    Replies:
    2
    Views:
    2,269
    Smokey Grindel
    Dec 2, 2006
  2. Replies:
    3
    Views:
    1,028
    Roedy Green
    Jul 8, 2008
  3. Replies:
    3
    Views:
    1,194
  4. Brian
    Replies:
    0
    Views:
    647
    Brian
    Jun 25, 2009
  5. kiran
    Replies:
    12
    Views:
    1,228
    Scott Sauyet
    Dec 7, 2011
Loading...

Share This Page