5/08/2013

Resolve 'java.security.NoSuchProviderException No such provider: BC'

In the class, add:


static
    {
        Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
    }

add bcprov-jdk jar file

 maven dependency
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk16</artifactId>
<version>1.46</version>
</dependency>

This is for jdk 1.6, if jdk version is different, pick the right version instead.

No comments:

Post a Comment