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