Created
October 25, 2021 00:47
-
-
Save lhazlewood/2fb5c40603d39603d4dc9a4de6f0b913 to your computer and use it in GitHub Desktop.
List all of a JDKs supported elliptic curve names
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
for (Provider provider : Security.getProviders()) { | |
for (def service : provider.getServices()) { | |
if (service.getType() == 'AlgorithmParameters' && service.getAlgorithm() == 'EC') { | |
String result = service.getAttribute('SupportedCurves') | |
String[] split = Strings.delimitedListToStringArray(result, '|') | |
println "supported curves: " | |
for(String s : split) { | |
String[] cleaned = Strings.delimitedListToStringArray(s, ',' ,'[]') | |
Set<String> names = io.jsonwebtoken.lang.Collections.setOf(cleaned) | |
println names.join(', ') | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output from JDK 1.8.0_211 on MacOS: