blob: b1012d5b718597e8da0a5f8c2674a2a7d132b39e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
using Org.BouncyCastle.Asn1;
using Org.BouncyCastle.Asn1.X509;
using Org.BouncyCastle.Operators.Utilities;
namespace Org.BouncyCastle.Cmp
{
internal static class CmpUtilities
{
internal static byte[] CalculateCertHash(Asn1Encodable asn1Encodable, AlgorithmIdentifier signatureAlgorithm,
IDigestAlgorithmFinder digestAlgorithmFinder)
{
var digestAlgorithm = digestAlgorithmFinder.Find(signatureAlgorithm)
?? throw new CmpException("cannot find digest algorithm from signature algorithm");
return X509.X509Utilities.CalculateDigest(digestAlgorithm, asn1Encodable);
}
}
}
|