Created
August 26, 2013 13:31
-
-
Save juandesant/6341437 to your computer and use it in GitHub Desktop.
Code to show available cryptography provides in Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.security.Provider; | |
import java.security.Security; | |
import java.util.Arrays; | |
public class ShowCryptoProviders | |
{ | |
public static void main(final String[] args) | |
{ | |
final Provider[] providers = Security.getProviders(); | |
for (final Provider p : providers) | |
{ | |
System.out.format("%s %s%s", p.getName(), p.getVersion(), System.getProperty("line.separator")); | |
for (final Object o : p.keySet()) | |
{ | |
if (Arrays.asList(args).contains("-v")) | |
{ | |
System.out.format("\t%s : %s%s", o, p.getProperty((String)o), System.getProperty("line.separator")); | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment