List of usage examples for java.security.spec MGF1ParameterSpec SHA1
MGF1ParameterSpec SHA1
To view the source code for java.security.spec MGF1ParameterSpec SHA1.
Click Source Link
From source file:com.fabernovel.alertevoirie.webservice.HttpPostRequest.java
private static String sha1(String raw) throws UnsupportedEncodingException, NoSuchAlgorithmException { byte[] bytes = raw.getBytes("UTF-8"); MessageDigest md = MessageDigest.getInstance(MGF1ParameterSpec.SHA1.getDigestAlgorithm()); md.update(bytes);/*from w ww . j a va 2 s .c o m*/ byte[] digest = md.digest(); return toHex(digest); }