summary refs log tree commit diff
path: root/crypto/src/asn1/esf/CrlIdentifier.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2022-11-09 12:55:04 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2022-11-09 12:55:04 +0700
commit278643286dc1f5a4e5ac155bbfe8b122e3dee784 (patch)
tree189d7a0bb4f448d9c754b0e11fb8b2b8b176cd6f /crypto/src/asn1/esf/CrlIdentifier.cs
parentIStreamGenerator changes (diff)
downloadBouncyCastle.NET-ed25519-278643286dc1f5a4e5ac155bbfe8b122e3dee784.tar.xz
Cleanup
Diffstat (limited to 'crypto/src/asn1/esf/CrlIdentifier.cs')
-rw-r--r--crypto/src/asn1/esf/CrlIdentifier.cs21
1 files changed, 8 insertions, 13 deletions
diff --git a/crypto/src/asn1/esf/CrlIdentifier.cs b/crypto/src/asn1/esf/CrlIdentifier.cs
index 4a2480b4b..54e930acc 100644
--- a/crypto/src/asn1/esf/CrlIdentifier.cs
+++ b/crypto/src/asn1/esf/CrlIdentifier.cs
@@ -1,5 +1,5 @@
 using System;
-using System.Reflection;
+
 using Org.BouncyCastle.Asn1.X509;
 using Org.BouncyCastle.Math;
 using Org.BouncyCastle.Utilities;
@@ -75,21 +75,16 @@ namespace Org.BouncyCastle.Asn1.Esf
 
         public CrlIdentifier(X509Name crlIssuer, Asn1UtcTime crlIssuedTime, BigInteger crlNumber)
         {
-            if (crlIssuer == null)
-                throw new ArgumentNullException(nameof(crlIssuer));
-            if (crlIssuedTime == null)
-                throw new ArgumentNullException(nameof(crlIssuedTime));
-
-            // Validate crlIssuedTime is in the appropriate year range
-            crlIssuedTime.ToDateTime(2049);
-
-            this.crlIssuer = crlIssuer;
-            this.crlIssuedTime = crlIssuedTime;
+            this.crlIssuer = crlIssuer ?? throw new ArgumentNullException(nameof(crlIssuer));
+            this.crlIssuedTime = crlIssuedTime ?? throw new ArgumentNullException(nameof(crlIssuedTime));
 
             if (null != crlNumber)
             {
                 this.crlNumber = new DerInteger(crlNumber);
             }
+
+            // Validate crlIssuedTime is in the appropriate year range
+            this.crlIssuedTime.ToDateTime(2049);
         }
 
         public X509Name CrlIssuer
@@ -104,12 +99,12 @@ namespace Org.BouncyCastle.Asn1.Esf
 
 		public BigInteger CrlNumber
 		{
-			get { return crlNumber == null ? null : crlNumber.Value; }
+			get { return crlNumber?.Value; }
 		}
 
 		public override Asn1Object ToAsn1Object()
 		{
-			Asn1EncodableVector v = new Asn1EncodableVector(crlIssuer.ToAsn1Object(), crlIssuedTime);
+			var v = new Asn1EncodableVector(crlIssuer.ToAsn1Object(), crlIssuedTime);
             v.AddOptional(crlNumber);
 			return new DerSequence(v);
 		}