Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

RSA with bouncycastle

51 views
Skip to first unread message

b.cro...@gmail.com

unread,
Jun 20, 2005, 12:52:35 PM6/20/05
to
Hi!
With this code...

------
import org.bouncycastle.jce.provider.BouncyCastleProvider;
[...]
Cipher c = Cipher.getInstance("RSA/ECB/PKCS1Padding", "BC");
------

I have the error :

java.security.NoSuchProviderException: Provider 'BC' not found
at javax.crypto.Cipher.getInstance(DashoA6275)


I have the jar files : bcmail-jdk14-128.jar & bcprov-jdk14-128.jar with
jdk1.4

What's wrong?

Thanks.

Tommy Grändefors

unread,
Jun 21, 2005, 3:50:36 AM6/21/05
to
Hi,

You must add the Bouncy Castle provider as a new security provider
before getting the cipher instance (note: you only have to do this once
in your application):
java.security.Security.addProvider(new
org.bouncycastle.jce.provider.BouncyCastleProvider());

Regards,
Tommy
www.pheox.com

0 new messages