Java Security get Bouncy Castle provider

Introduction

List the available capabilities for ciphers, key agreement, macs, message digests, signatures and other objects in the BC provider.


import java.security.Provider;
import java.security.Security;
import java.util.Iterator;


public class Main {
  public static void main(String[] args) {
    Provider provider = Security.getProvider("BC");

    Iterator it = provider.keySet().iterator();

    while (it.hasNext()) {
      String entry = (String) it.next();
      String factoryClass = entry.substring(0, entry.indexOf('.'));
      String name = entry.substring(factoryClass.length() + 1);

      System.out.println(factoryClass + ": " + name);
    }/*  w  w w .  j a v  a  2s  .c o  m*/
  }
}



PreviousNext

Related