Skip to content

Instantly share code, notes, and snippets.

@juandesant
Created August 26, 2013 13:31
Show Gist options
  • Save juandesant/6341437 to your computer and use it in GitHub Desktop.
Save juandesant/6341437 to your computer and use it in GitHub Desktop.
Code to show available cryptography provides in Java
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