summary refs log tree commit diff
path: root/crypto/src/crmf/CertificateReqMessagesBuilder.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/crmf/CertificateReqMessagesBuilder.cs')
-rw-r--r--crypto/src/crmf/CertificateReqMessagesBuilder.cs28
1 files changed, 28 insertions, 0 deletions
diff --git a/crypto/src/crmf/CertificateReqMessagesBuilder.cs b/crypto/src/crmf/CertificateReqMessagesBuilder.cs
new file mode 100644
index 000000000..813f1d9e3
--- /dev/null
+++ b/crypto/src/crmf/CertificateReqMessagesBuilder.cs
@@ -0,0 +1,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;
+        }
+    }
+}