Get cryptographic security providers : Algorithms « Security « Java






Get cryptographic security providers

  

import java.security.Provider;
import java.security.Security;
import java.util.HashSet;
import java.util.Set;

public class Main {
  public static void main(String[] args) {
    Set<Object> result = new HashSet<Object>();
    Provider[] providers = Security.getProviders();
    for (Provider provider : providers) {
      Set<Object> keys = provider.keySet();
      for (Object key : keys) {
        String data = (String) key;
        data = data.split(" ")[0];
        if (data.startsWith("Alg.Alias")) {
          data = data.substring(10);
        }
        data = data.substring(0, data.indexOf('.'));
        result.add(data);
      }
    }
    for (Object o : result) {
      System.out.println("Service Type = " + o);
    }
  }
}
 

   
    
  








Related examples in the same category

1.What is in bouncycastle (bouncy castle)
2.JCE algorithms in BrowserJCE algorithms in Browser
3.Listing All Available Cryptographic Services
4.Return the available implementations for a service type
5.Generating a Parameter Set for the Diffie-Hellman Key Agreement Algorithm