Using Bouncy Castle Crypto api

90 views
Skip to first unread message

david...@gmail.com

unread,
May 18, 2014, 7:56:32 PM5/18/14
to codenameone...@googlegroups.com
When using the Bouncy Castle Crypto api any example I see on the net uses javax.crypto.*  and yet this library is not available when you build the application even though it is a library for the project I have created.

error: package javax.crypto does not exist
import javax.crypto.Cipher;

It be very useful if there is a working example using the bouncy castle cn1lib as anything I have found to date seems to only work if you are creating "normal" java application.


Shai Almog

unread,
May 19, 2014, 1:25:07 AM5/19/14
to codenameone...@googlegroups.com, david...@gmail.com
Our version of bouncy castle is based on the J2ME version of it so it doesn't have the dependency of javax.crypto which we don't support. Just search for j2me samples for bouncy castle and base your code on that.

David Smith

unread,
Oct 9, 2014, 4:01:08 PM10/9/14
to codenameone...@googlegroups.com
I think I found one here http://www.itcsolutions.eu/2010/12/28/how-to-encrypt-decrypt-with-aes-from-bouncy-castle-api-in-j2me-applications/ you just have to remove the first three exceptions from the throws in the encrypt method.

shop.servic...@gmail.com

unread,
Sep 6, 2017, 3:53:50 PM9/6/17
to CodenameOne Discussions, bamag...@gmail.com
I have successfully implemented AES encryption using BouncyCastleCN1Lib.cn1lib
Attached is a running example AES_BC_TEST project src files

Regards
AES_BC.java
AES_BC_TEST.java
Reply all
Reply to author
Forward
0 new messages