Pattern digestPattern = Pattern.compile( "^(Alg\\.Alias\\.)?MessageDigest\\.(?<alg>(\\w|-)+)" ); for ( Provider p : Security.getProviders() ) { for ( Object o : Collections.list( p.keys() ) ) { for ( Matcher m = digestPattern.matcher( o.toString() ); m.find(); ) System.out.println( m.group("alg") ); } }
The result is:
SHA-1 SHA MD5 SHA-384 SHA-512 SHA1 SHA MD5 SHA-256 MD2
Also look at http://download.java.net/jdk8/docs/technotes/guides/security/StandardNames.html.