summary refs log tree commit diff
path: root/crypto/src/cmp/CertificateConfirmationContent.cs
blob: 13d1dab8edda81e89a0ef8116cb92d46afe78acd (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
33
34
35
36
37
38
39
40
41
42
43
using Org.BouncyCastle.Cms;
using Org.BouncyCastle.Asn1.Cmp;


namespace Org.BouncyCastle.Cmp
{
    public class CertificateConfirmationContent
    {
        private DefaultDigestAlgorithmIdentifierFinder digestAlgFinder;
        private CertConfirmContent content;


        public CertificateConfirmationContent(CertConfirmContent content)
        {
            this.content = content;
        }

        public CertificateConfirmationContent(CertConfirmContent content,
            DefaultDigestAlgorithmIdentifierFinder digestAlgFinder)
        {
            this.content = content;
            this.digestAlgFinder = digestAlgFinder;
        }

        public CertConfirmContent ToAsn1Structure()
        {
            return content;
        }

        public CertificateStatus[] GetStatusMessages()
        {
            CertStatus[] statusArray = content.ToCertStatusArray();
            CertificateStatus[] ret = new CertificateStatus[statusArray.Length];
            for (int i = 0; i != ret.Length; i++)
            {
                ret[i] = new CertificateStatus(digestAlgFinder, statusArray[i]);
            }

            return ret;
        } 
    }
}