public static byte[] ComputeHashValue(byte[] value, FirmaXades.Crypto.DigestMethod digestMethod) { using (HashAlgorithm hashAlgorithm = digestMethod.GetHashAlgorithm()) { return(hashAlgorithm.ComputeHash(value)); } }
public static void SetCertDigest(byte[] rawCert, FirmaXades.Crypto.DigestMethod digestMethod, DigestAlgAndValueType destination) { using (HashAlgorithm hashAlgorithm = digestMethod.GetHashAlgorithm()) { destination.DigestMethod.Algorithm = digestMethod.URI; destination.DigestValue = hashAlgorithm.ComputeHash(rawCert); } }