java技巧-获取支持的算法和算法支持的模式
获得所有支持的算法
1
2
3
4
5
6
7for (Provider provider : Security.getProviders()){
System.out.println("Provider: " + provider.getName());
for (Provider.Service service : provider.getServices()){
System.out.println(" Algorithm: " + service.getAlgorithm());
}
System.out.println();
}获得算法支持的模式
1
2
3
4
5
6
7for (Provider provider : Security.getProviders()) {
System.out.println("Provider: " + provider.getName());
for (Provider.Service service : provider.getServices()) {
System.out.println(" Algorithm Pattern: " + service);
}
System.out.println("\n");
}