• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with decryption  RSS feed

 
Nikhil Bansal
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,

I am using iPlanet 6.0. The Server Classpath is :

C:/iPlanet/Servers/plugins/servlets/examples/legacy/beans.10/SDKBeans10.jar;c:/j2sdk1.4.2_03/bin;c:/j2sdk1.4.2_03/lib;C:/Devendra/j2sdk1.4.2_03/jre/lib/jce.jar;C:/Devendra/jce1.2.2/lib/local_policy.jar;C:/Devendra/jce1.2.2/lib/US_export_policy.jar;

My task is to decrypt a password.I am using java api's import java.security,java.security.spec,javax.crypto and javax.crypto.spec.

The class is giving the foll. exception when called from the Servlet.Plz tell me what's wrong.I suppose tht it has something to do with the classpath.Therz nothin wrong with the code.


[08/Apr/2006:15:38:31] failure ( 2252): Internal error: Unexpected error condition thrown (unknown exception,no description), stack: java.lang.ExceptionInInitializerError
at javax.crypto.SecretKeyFactory.getInstance(DashoA6275)
at security.BOSEncryption_Citi.(BOSEncryption_Citi.java:40)
at security.BOSEncryption_Citi.decrypt(BOSEncryption_Citi.java:91)
at WebStartUpServlet_Citi.init(WebStartUpServlet_Citi.java:101)
at com.iplanet.server.http.servlet.NSServletEntity.load(NSServletEntity.java:405)
at com.iplanet.server.http.servlet.NSServletEntity.update(NSServletEntity.java:173)
at com.iplanet.server.http.servlet.NSServletEntity.update(NSServletEntity.java:165)
at com.iplanet.server.http.servlet.NSServletRunner.(NSServletRunner.java:157)
Caused by: java.lang.SecurityException: Cannot set up certs for trusted CAs
at javax.crypto.SunJCE_b.(DashoA6275)
... 8 more
Caused by: java.security.PrivilegedActionException: java.security.NoSuchAlgorithmException: MD5WITHRSA Signature not available
at java.security.AccessController.doPrivileged(Native Method)
... 9 more
Caused by: java.security.NoSuchAlgorithmException: MD5WITHRSA Signature not available
at java.security.Security.getEngineClassName(Security.java:584)
at java.security.Security.getEngineClassName(Security.java:595)
at java.security.Security.getImpl(Security.java:1044)
at java.security.Signature.getInstance(Signature.java:169)
at sun.security.x509.X509CertImpl.verify(X509CertImpl.java:425)
at sun.security.x509.X509CertImpl.verify(X509CertImpl.java:383)
at javax.crypto.SunJCE_b.c(DashoA6275)
at javax.crypto.SunJCE_b.b(DashoA6275)
at javax.crypto.SunJCE_s.run(DashoA6275)
... 10 more


Regards

Nikhil
 
M Anderson
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may need to check your Java Policy file(s).


Caused by: java.lang.SecurityException: Cannot set up certs for trusted CAs
at javax.crypto.SunJCE_b.(DashoA6275)
... 8 more
Caused by: java.security.PrivilegedActionException: java.security.NoSuchAlgorithmException: MD5WITHRSA Signature not available


It sounds like there's a restriction on your machine that won't allow you to run Java's security code. Or the 'MD5WITHRSA' isn't a valid parameter to whatever method you're using to decrypt.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!