summary refs log tree commit diff
path: root/crypto/src/cmp/CertificateConfirmationContent.cs
blob: ceb34e2c87f7bbb98cbcb5a680b86f4c54ded626 (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
using System;

using Org.BouncyCastle.Asn1.Cmp;
using Org.BouncyCastle.Cms;

namespace Org.BouncyCastle.Cmp
{
    public class CertificateConfirmationContent
    {
        private readonly DefaultDigestAlgorithmIdentifierFinder m_digestAlgFinder;
        private readonly CertConfirmContent m_content;

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

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

        public CertConfirmContent ToAsn1Structure()
        {
            return m_content;
        }

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

            return ret;
        }
    }
}