Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem in Handling BouncyCastle

 
Battula lakshman
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic