summary refs log tree commit diff
path: root/crypto/src/crmf/CertificateReqMessagesBuilder.cs
blob: 813f1d9e3808a0b42c223c58aee2bf909b01c34a (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
using System;
using System.Collections.Generic;

using Org.BouncyCastle.Asn1.Crmf;

namespace Org.BouncyCastle.Crmf
{
    public class CertificateReqMessagesBuilder
    {
        private readonly List<CertReqMsg> m_requests = new List<CertReqMsg>();

        public CertificateReqMessagesBuilder()
        {
        }

        public virtual void AddRequest(CertificateRequestMessage request) => m_requests.Add(request.ToAsn1Structure());

        public virtual CertificateReqMessages Build()
        {
            CertificateReqMessages certificateReqMessages = new CertificateReqMessages(
                new CertReqMessages(m_requests.ToArray()));

            m_requests.Clear();

            return certificateReqMessages;
        }
    }
}