I am able to call MessageDigest as a local variable in main() method of my code, but whenever I try creating a field variable of MessageDigest in a class, and try initializing it in a constructor, it throws a NoSuchAlgorithm exception.
My gut feeling is that we just cannot instantiate MessageDigest objects like that. Is that true?
Basically, this is what I did. I want to use this as a field variable, and not a local variable.