/** * Creates a hash using a specific digest algorithm and a provider. * @param data the message of which you want to create a hash * @param hashAlgorithm the algorithm used to create the hash * @param provider the provider used to create the hash * @return the hash * @throws GeneralSecurityException * @throws IOException */ public static byte[] digest(InputStream data, String hashAlgorithm, String provider) throws GeneralSecurityException, IOException { MessageDigest messageDigest = getMessageDigest(hashAlgorithm, provider); return digest(data, messageDigest); }
/** * Creates a hash using a specific digest algorithm and a provider. * @param data the message of which you want to create a hash * @param hashAlgorithm the algorithm used to create the hash * @param provider the provider used to create the hash * @return the hash * @throws GeneralSecurityException * @throws IOException */ public static byte[] digest(InputStream data, String hashAlgorithm, String provider) throws GeneralSecurityException, IOException { MessageDigest messageDigest = getMessageDigest(hashAlgorithm, provider); return digest(data, messageDigest); }
byte hash[] = DigestAlgorithms.digest(data, externalDigest.getMessageDigest(hashAlgorithm)); byte[] ocsp = null; if (chain.length >= 2 && ocspClient != null) {
byte hash[] = DigestAlgorithms.digest(data, externalDigest.getMessageDigest(hashAlgorithm)); byte[] ocsp = null; if (chain.length >= 2 && ocspClient != null) {