public static void SetCertDigest(byte[] rawCert, string digestAlgorithm, DigestAlgAndValueType destination) { using (var hashAlg = GetHashAlg(digestAlgorithm)) { destination.DigestMethod.Algorithm = digestAlgorithm; destination.DigestValue = hashAlg.ComputeHash(rawCert); } }
public static void SetCertDigest(byte[] rawCert, string digestAlgorithm, DigestAlgAndValueType destination) { using (var hashAlg = GetHashAlg(digestAlgorithm)) { destination.DigestMethod.Algorithm = "http://www.w3.org/2000/09/xmldsig#sha1"; //digestAlgorithm; destination.DigestValue = hashAlg.ComputeHash(rawCert); } }
public static void SetCertDigest(byte[] rawCert, DigestMethod digestMethod, DigestAlgAndValueType destination) { string digestAlgorithm = null; switch (digestMethod) { case DigestMethod.SHA1: digestAlgorithm = FirmaXades.SHA1Uri; break; case DigestMethod.SHA256: digestAlgorithm = FirmaXades.SHA256Uri; break; case DigestMethod.SHA512: digestAlgorithm = FirmaXades.SHA512Uri; break; } SetCertDigest(rawCert, digestAlgorithm, destination); }
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); } }