summary refs log tree commit diff
path: root/crypto/src/asn1/esf
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/asn1/esf')
-rw-r--r--crypto/src/asn1/esf/CertificateValues.cs3
-rw-r--r--crypto/src/asn1/esf/CompleteCertificateRefs.cs3
-rw-r--r--crypto/src/asn1/esf/CompleteRevocationRefs.cs3
-rw-r--r--crypto/src/asn1/esf/CrlListID.cs3
-rw-r--r--crypto/src/asn1/esf/OcspListID.cs3
-rw-r--r--crypto/src/asn1/esf/OtherSigningCertificate.cs9
-rw-r--r--crypto/src/asn1/esf/RevocationValues.cs12
-rw-r--r--crypto/src/asn1/esf/SignaturePolicyId.cs6
8 files changed, 4 insertions, 38 deletions
diff --git a/crypto/src/asn1/esf/CertificateValues.cs b/crypto/src/asn1/esf/CertificateValues.cs
index 384094511..2c0a4b444 100644
--- a/crypto/src/asn1/esf/CertificateValues.cs
+++ b/crypto/src/asn1/esf/CertificateValues.cs
@@ -38,9 +38,6 @@ namespace Org.BouncyCastle.Asn1.Esf
 
         public CertificateValues(params X509CertificateStructure[] certificates)
 		{
-			if (certificates == null)
-				throw new ArgumentNullException(nameof(certificates));
-
 			m_certificates = DerSequence.FromElements(certificates);
 		}
 
diff --git a/crypto/src/asn1/esf/CompleteCertificateRefs.cs b/crypto/src/asn1/esf/CompleteCertificateRefs.cs
index 4e8f122ca..637571ea3 100644
--- a/crypto/src/asn1/esf/CompleteCertificateRefs.cs
+++ b/crypto/src/asn1/esf/CompleteCertificateRefs.cs
@@ -36,9 +36,6 @@ namespace Org.BouncyCastle.Asn1.Esf
 
 		public CompleteCertificateRefs(params OtherCertID[] otherCertIDs)
 		{
-			if (otherCertIDs == null)
-				throw new ArgumentNullException(nameof(otherCertIDs));
-
 			m_otherCertIDs = DerSequence.FromElements(otherCertIDs);
 		}
 
diff --git a/crypto/src/asn1/esf/CompleteRevocationRefs.cs b/crypto/src/asn1/esf/CompleteRevocationRefs.cs
index 82ac6beab..aa3b7cc10 100644
--- a/crypto/src/asn1/esf/CompleteRevocationRefs.cs
+++ b/crypto/src/asn1/esf/CompleteRevocationRefs.cs
@@ -36,9 +36,6 @@ namespace Org.BouncyCastle.Asn1.Esf
 
 		public CompleteRevocationRefs(params CrlOcspRef[] crlOcspRefs)
 		{
-			if (crlOcspRefs == null)
-				throw new ArgumentNullException(nameof(crlOcspRefs));
-
 			m_crlOcspRefs = DerSequence.FromElements(crlOcspRefs);
 		}
 
diff --git a/crypto/src/asn1/esf/CrlListID.cs b/crypto/src/asn1/esf/CrlListID.cs
index f9ca95e24..6d05c3971 100644
--- a/crypto/src/asn1/esf/CrlListID.cs
+++ b/crypto/src/asn1/esf/CrlListID.cs
@@ -44,9 +44,6 @@ namespace Org.BouncyCastle.Asn1.Esf
 
 		public CrlListID(params CrlValidatedID[] crls)
 		{
-			if (crls == null)
-				throw new ArgumentNullException(nameof(crls));
-
 			m_crls = DerSequence.FromElements(crls);
 		}
 
diff --git a/crypto/src/asn1/esf/OcspListID.cs b/crypto/src/asn1/esf/OcspListID.cs
index a821e6b17..5784fffe0 100644
--- a/crypto/src/asn1/esf/OcspListID.cs
+++ b/crypto/src/asn1/esf/OcspListID.cs
@@ -43,9 +43,6 @@ namespace Org.BouncyCastle.Asn1.Esf
 
         public OcspListID(params OcspResponsesID[] ocspResponses)
 		{
-			if (ocspResponses == null)
-				throw new ArgumentNullException(nameof(ocspResponses));
-
 			m_ocspResponses = DerSequence.FromElements(ocspResponses);
 		}
 
diff --git a/crypto/src/asn1/esf/OtherSigningCertificate.cs b/crypto/src/asn1/esf/OtherSigningCertificate.cs
index 78fda76d1..f9333eb6c 100644
--- a/crypto/src/asn1/esf/OtherSigningCertificate.cs
+++ b/crypto/src/asn1/esf/OtherSigningCertificate.cs
@@ -54,15 +54,8 @@ namespace Org.BouncyCastle.Asn1.Esf
 
 		public OtherSigningCertificate(OtherCertID[] certs, params PolicyInformation[] policies)
 		{
-			if (certs == null)
-                throw new ArgumentNullException(nameof(certs));
-
             m_certs = DerSequence.FromElements(certs);
-
-			if (policies != null)
-			{
-				m_policies = DerSequence.FromElements(policies);
-			}
+            m_policies = DerSequence.FromElementsOptional(policies);
 		}
 
 		public OtherSigningCertificate(IEnumerable<OtherCertID> certs)
diff --git a/crypto/src/asn1/esf/RevocationValues.cs b/crypto/src/asn1/esf/RevocationValues.cs
index 2d9175275..78cc1af0d 100644
--- a/crypto/src/asn1/esf/RevocationValues.cs
+++ b/crypto/src/asn1/esf/RevocationValues.cs
@@ -59,16 +59,8 @@ namespace Org.BouncyCastle.Asn1.Esf
 
         public RevocationValues(CertificateList[] crlVals, BasicOcspResponse[] ocspVals, OtherRevVals otherRevVals)
 		{
-			if (crlVals != null)
-			{
-				m_crlVals = DerSequence.FromElements(crlVals);
-			}
-
-			if (ocspVals != null)
-			{
-				m_ocspVals = DerSequence.FromElements(ocspVals);
-			}
-
+            m_crlVals = DerSequence.FromElementsOptional(crlVals);
+            m_ocspVals = DerSequence.FromElementsOptional(ocspVals);
 			m_otherRevVals = otherRevVals;
 		}
 
diff --git a/crypto/src/asn1/esf/SignaturePolicyId.cs b/crypto/src/asn1/esf/SignaturePolicyId.cs
index 18ea1634a..8d1adc891 100644
--- a/crypto/src/asn1/esf/SignaturePolicyId.cs
+++ b/crypto/src/asn1/esf/SignaturePolicyId.cs
@@ -62,11 +62,7 @@ namespace Org.BouncyCastle.Asn1.Esf
 		{
 			m_sigPolicyIdentifier = sigPolicyIdentifier ?? throw new ArgumentNullException(nameof(sigPolicyIdentifier));
             m_sigPolicyHash = sigPolicyHash ?? throw new ArgumentNullException(nameof(sigPolicyHash));
-
-            if (sigPolicyQualifiers != null)
-			{
-				m_sigPolicyQualifiers = DerSequence.FromElements(sigPolicyQualifiers);
-			}
+            m_sigPolicyQualifiers = DerSequence.FromElementsOptional(sigPolicyQualifiers);
 		}
 
 		public SignaturePolicyId(DerObjectIdentifier sigPolicyIdentifier, OtherHashAlgAndValue sigPolicyHash,