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