Skip to content

Instantly share code, notes, and snippets.

@nicoulaj
Created August 17, 2010 20:06
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save nicoulaj/531761 to your computer and use it in GitHub Desktop.
Save nicoulaj/531761 to your computer and use it in GitHub Desktop.
List all Java Security providers and algorithms available in the environment.
import java.security.Provider;
import java.security.Security;
import java.util.Enumeration;
public class SecurityProvidersAndAlgorithms {
public static void main(String[] args) throws Exception {
try {
Provider p[] = Security.getProviders();
for (int i = 0; i < p.length; i++) {
System.out.println(p[i]);
for (Enumeration e = p[i].keys(); e.hasMoreElements();)
System.out.println("\t" + e.nextElement());
}
} catch (Exception e) {
System.out.println(e);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment