Here you can find the source of sha1Sum(byte[] ba)
private static byte[] sha1Sum(byte[] ba)
//package com.java2s; //License from project: Open Source License import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class Main { /**/*from ww w .j a v a 2 s. c o m*/ * This method is used to calculate key identifiers. * Both RFC 3280 and RFC 5280 provide examples on * key identifier generation. */ private static byte[] sha1Sum(byte[] ba) { byte[] digest = null; MessageDigest md = null; try { md = MessageDigest.getInstance("SHA-1"); md.update(ba); digest = md.digest(); } catch (NoSuchAlgorithmException e) { /* * Swallowing because all JCE providers require * SHA-1 support */ } return digest; } }