Basic class to confirm the Bouncy Castle provider is installed. : Bouncy Castle « Security « Java Tutorial






import java.security.Security;

public class MainClass {
  public static void main(String[] args) {
    String providerName = "BC";

    if (Security.getProvider(providerName) == null) {
      System.out.println(providerName + " provider not installed");
    } else {
      System.out.println(providerName + " is installed.");
    }
  }
}








36.6.Bouncy Castle
36.6.1.Basic class to confirm the Bouncy Castle provider is installed.
36.6.2.Basic demonstration of precedence