File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java Micro Edition and the fly likes problem in Handling BouncyCastle Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "problem in Handling BouncyCastle" Watch "problem in Handling BouncyCastle" New topic
Author

problem in Handling BouncyCastle

Battula lakshman
Greenhorn

Joined: Apr 24, 2006
Posts: 9
hi all,
I am little novice in developing the Security application. I am devloping an application in which i was supposed to Encrypt the data in the MIDlet side.
I am getting the fallowing Exception
java.lang.NoClassDefFoundError: java/security/SecureRandom: Cannot create class in system package
at org.bouncycastle.crypto.encodings.PKCS1Encoding.init(+35)
at Cryptor.doEncrypt(+64)
at BouncyTest$CryptCanvas.keyPressed(+45)
at javax.microedition.lcdui.Canvas.callKeyPressed(+19)
at javax.microedition.lcdui.Display$DisplayAccessor.keyEvent(+198)
at javax.microedition.lcdui.Display$DisplayManagerImpl.keyEvent(+11)
at com.sun.midp.lcdui.DefaultEventHandler.keyEvent(+121)
at com.sun.midp.lcdui.AutomatedEventHandler.keyEvent(+210)
at com.sun.midp.lcdui.DefaultEventHandler$QueuedEventHandler.run(+178)
Can anybody please tell me how come to include the SecureRandom in this MIDlet.I am unable to find the solution for this.
Please help me in this...
lakshman
Battula lakshman
Greenhorn

Joined: Apr 24, 2006
Posts: 9
hi all,
I am using the proguard for obfuscation of the Application.AS obfuscator main goal was to decompile and removing the non using classes and including the classes the MIDlet needed.
As expected , i thought that Java.security.SecureRandom will include into the JAR after Obfuscation.
The Java.security.SecureRandom was available in the BouncyCastle, but it did not do anything instead, after running the application it was again giving the application which was little different from the previous one
java.lang.NoClassDefFoundError: java/security/a: Cannot create class in system package
at org.bouncycastle.crypto.encodings.a.a(+31)
at a.a(+64)
at b.keyPressed(+45)
at javax.microedition.lcdui.Canvas.callKeyPressed(+19)
at javax.microedition.lcdui.Display$DisplayAccessor.keyEvent(+198)
at javax.microedition.lcdui.Display$DisplayManagerImpl.keyEvent(+11)
at com.sun.midp.lcdui.DefaultEventHandler.keyEvent(+121)
at com.sun.midp.lcdui.AutomatedEventHandler.keyEvent(+210)
at com.sun.midp.lcdui.DefaultEventHandler$QueuedEventHandler.run(+178)
can you please tell me which will make the application to Encrypt the data by avoiding the Exception at present i am getting
Please rectify me, if i given any wrong information about obfuscators.
Thanks for your help
lakshman
 
 
subject: problem in Handling BouncyCastle