Reputation: 33
I encountered a problem while trying to get my java project running on my Debian 10 server. Everything seems to work, but java throws an error when i try to get an instance of a MessageDigest with "SHA256".
It occurs in this line:
MessageDigest digest = MessageDigest.getInstance("SHA256");
The exception:
java.security.NoSuchAlgorithmException: SHA256 MessageDigest not available
Is there a way to install SHA256 functionality or another way i can create a sha256 hash?
Upvotes: 0
Views: 576
Reputation: 3273
MessageDigest.getInstance("SHA-256");
and to list all available:
Set<String> messageDigest = Security.getAlgorithms("MessageDigest");
messageDigest.forEach(System.out::println);
Upvotes: 1