<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body style="background-color: rgb(255, 255, 255); color: rgb(0, 0,
0);" text="#000000" bgcolor="#FFFFFF">
<br>
<div class="moz-cite-prefix">On 12/12/2014 02:20 PM, Sean Mullan
wrote:<br>
</div>
<blockquote cite="mid:548AEBAF.7030609@oracle.com" type="cite"><!--[if !IE]><DIV style="border-left: 2px solid #009900; border-right: 2px solid #009900; padding: 0px 15px; margin: 2px 0px;"><![endif]-->On
12/12/2014 12:04 AM, Bernd Eckenfels wrote:
<br>
<blockquote type="cite"><!--[if !IE]><DIV style="border-left: 2px solid #009900; border-right: 2px solid #009900; padding: 0px 15px; margin: 2px 0px;"><![endif]-->Just
get it and throw it away, it is easier than iterating the
algorithms of the providers.
<br>
<!--[if !IE]></DIV><![endif]--></blockquote>
<br>
Yes, probably. But as you note, the other way is to iterate over
the Providers returned by Security.getProviders(), and call
p.getService("MessageDigest", "SHA-256") on each ...
<br>
<br>
<!--[if !IE]></DIV><![endif]--></blockquote>
<br>
Even simpler:<br>
<br>
java.security.Security.getAlgorithms("MessageDigest").contains("SHA-256")<br>
<br>
Regards, Peter<br>
<br>
<br>
<blockquote cite="mid:548AEBAF.7030609@oracle.com" type="cite"><!--[if !IE]><DIV style="border-left: 2px solid #009900; border-right: 2px solid #009900; padding: 0px 15px; margin: 2px 0px;"><![endif]-->--Sean
<br>
<br>
<blockquote type="cite"><!--[if !IE]><DIV style="border-left: 2px solid #009900; border-right: 2px solid #009900; padding: 0px 15px; margin: 2px 0px;"><![endif]-->
<br>
<br>
<blockquote type="cite"><!--[if !IE]><DIV style="border-left: 2px solid #009900; border-right: 2px solid #009900; padding: 0px 15px; margin: 2px 0px;"><![endif]-->Am
12.12.2014 um 05:02 schrieb Weijun Wang
<a class="moz-txt-link-rfc2396E" href="mailto:weijun.wang@oracle.com"><weijun.wang@oracle.com></a>:
<br>
<br>
I'd like to check if "SHA-256" is supported without calling
MessageDigest.getInstance("SHA-256"). Does such a method
exist?
<br>
<br>
My case is a multi-thread digestor like this:
<br>
<br>
class Digestor {
<br>
Digestor(String alg) throws NSAE;
<br>
@ThreadSafe byte[] digest(byte[]) throws Nothing;
<br>
}
<br>
<br>
So a Digestor is created and multiple threads can call the
digest() method. I would be glad if the constructor can throw
an NSAE but not creating a MessageDigest object because I
don't know how to safely use it inside digest().
<br>
<br>
Thanks
<br>
Max
<br>
<!--[if !IE]></DIV><![endif]--></blockquote>
<!--[if !IE]></DIV><![endif]--></blockquote>
<!--[if !IE]></DIV><![endif]--></blockquote>
<br>
</body>
</html>