Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
Posts: 20
Registered: ‎04-11-2009
My Device: Not Specified

BouncyCastle library

I'm trying to use BouncyCastle library to do RSA data encryption. So I've downloaded library sources and compiled it using NetBeans MIDP 2.0 and CLDC 1.1 configuration. The resuling file is attached to a library project which was created in current workspace. Everything is compiled correctly but when the application is started via simulator an exception is raised:

 

Error starting LoginPanel: Symbol 'Object.clone' not found. 

 

What am I doing wrong?

 

Thanks in advance,

Mikhail. 

Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: BouncyCastle library

The clone() method is not implemented in the J2ME version of Object.

 

New Developer
Posts: 20
Registered: ‎04-11-2009
My Device: Not Specified

Re: BouncyCastle library

Also, I've tried to preferify this (BouncyCastle) JAR file and the error is as follows:

Error preverifying class java.io.FilterInputStream

    java/lang/NoClassDefFoundError: java/io/InputStream

 

This is the version named  'lcrypto-j2me-142.zip'

Seems that there is no InputStream in MIDP, right?

But how can this lightweight version can be compiled or may be there is another one? 

New Developer
Posts: 20
Registered: ‎04-11-2009
My Device: Not Specified

Re: BouncyCastle library

Yes, but then, how to compile BouncyCastle?
Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: BouncyCastle library

Well i had "lcrypto-j2me-138" and it compiled with out any problem.

Use Search. "Accept Solution" If the problem is resolved.
New Developer
Posts: 20
Registered: ‎04-11-2009
My Device: Not Specified

Re: BouncyCastle library

How did you compile it? I'm using NetBeans 6.5.1 -> Java ME -> Mobile Class Library -> CLDC-1.1, MIDP-2.1. Then just copy BouncyCastle files to the src folder and the build the library.
Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: BouncyCastle library

No, I use JDE and created new project.

Use Search. "Accept Solution" If the problem is resolved.
New Developer
Posts: 20
Registered: ‎04-11-2009
My Device: Not Specified

Re: BouncyCastle library

Did you manually add all files from BouncyCastle to that project?
Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: BouncyCastle library

No, created the project as library and added the BouncyCastle jar and compiled.

Use Search. "Accept Solution" If the problem is resolved.
New Developer
Posts: 20
Registered: ‎04-11-2009
My Device: Not Specified

Re: BouncyCastle library

Yes, but where did you get that BouncyCastle.jar file ?