summary refs log tree commit diff
path: root/crypto/src/operators/utilities/IDigestAlgorithmFinder.cs
blob: 867829dba7139da0d9c4136854f8065cabfd5420 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using Org.BouncyCastle.Asn1;
using Org.BouncyCastle.Asn1.X509;

namespace Org.BouncyCastle.Operators.Utilities
{
    /// <summary>
    /// Base interface for a finder of digest algorithm identifiers used with signatures.
    /// </summary>
    public interface IDigestAlgorithmFinder
    {
        /// <summary>
        /// Find the digest algorithm identifier that matches with the passed in signature algorithm identifier.
        /// </summary>
        /// <param name="signatureAlgorithm">the signature algorithm of interest.</param>
        /// <returns>an algorithm identifier for the corresponding digest.</returns>
        AlgorithmIdentifier Find(AlgorithmIdentifier signatureAlgorithm);

        /// <summary>
        /// Find the digest algorithm identifier that matches with the passed in digest name.
        /// </summary>
        /// <param name="digestOid">the OID of the digest algorithm of interest.</param>
        /// <returns>an algorithm identifier for the digest signature.</returns>
        AlgorithmIdentifier Find(DerObjectIdentifier digestOid);

        /// <summary>
        /// Find the digest algorithm identifier that matches with the passed in digest name.
        /// </summary>
        /// <param name="digestName">the name of the digest algorithm of interest.</param>
        /// <returns>an algorithm identifier for the digest signature.</returns>
        AlgorithmIdentifier Find(string digestName);
    }
}