summary refs log tree commit diff
path: root/crypto/src/x509
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2022-09-14 14:23:01 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2022-09-14 14:23:01 +0700
commit3124e402477d36636fad5ac3036ef56088cecf65 (patch)
treeae4c5b178e87d8fabd4feff0609448abb3d5dc3a /crypto/src/x509
parentadded Dilithium ack (diff)
downloadBouncyCastle.NET-ed25519-3124e402477d36636fad5ac3036ef56088cecf65.tar.xz
DateTimeObject => nullable DateTime
Diffstat (limited to 'crypto/src/x509')
-rw-r--r--crypto/src/x509/X509Crl.cs11
-rw-r--r--crypto/src/x509/store/X509AttrCertStoreSelector.cs5
-rw-r--r--crypto/src/x509/store/X509CertStoreSelector.cs9
-rw-r--r--crypto/src/x509/store/X509CrlStoreSelector.cs7
4 files changed, 10 insertions, 22 deletions
diff --git a/crypto/src/x509/X509Crl.cs b/crypto/src/x509/X509Crl.cs
index 8a7c51a1d..60660aab0 100644
--- a/crypto/src/x509/X509Crl.cs
+++ b/crypto/src/x509/X509Crl.cs
@@ -12,7 +12,6 @@ using Org.BouncyCastle.Math;
 using Org.BouncyCastle.Security;
 using Org.BouncyCastle.Security.Certificates;
 using Org.BouncyCastle.Utilities;
-using Org.BouncyCastle.Utilities.Date;
 using Org.BouncyCastle.Utilities.Encoders;
 using Org.BouncyCastle.X509.Extension;
 
@@ -163,15 +162,7 @@ namespace Org.BouncyCastle.X509
 			get { return c.ThisUpdate.ToDateTime(); }
 		}
 
-		public virtual DateTimeObject NextUpdate
-		{
-			get
-			{
-				return c.NextUpdate == null
-					?	null
-					:	new DateTimeObject(c.NextUpdate.ToDateTime());
-			}
-		}
+		public virtual DateTime? NextUpdate => c.NextUpdate?.ToDateTime();
 
 		private ISet<X509CrlEntry> LoadCrlEntries()
 		{
diff --git a/crypto/src/x509/store/X509AttrCertStoreSelector.cs b/crypto/src/x509/store/X509AttrCertStoreSelector.cs
index 5744289e9..e68208c74 100644
--- a/crypto/src/x509/store/X509AttrCertStoreSelector.cs
+++ b/crypto/src/x509/store/X509AttrCertStoreSelector.cs
@@ -5,7 +5,6 @@ using Org.BouncyCastle.Asn1;
 using Org.BouncyCastle.Asn1.X509;
 using Org.BouncyCastle.Math;
 using Org.BouncyCastle.Utilities.Collections;
-using Org.BouncyCastle.Utilities.Date;
 using Org.BouncyCastle.X509.Extension;
 
 namespace Org.BouncyCastle.X509.Store
@@ -23,7 +22,7 @@ namespace Org.BouncyCastle.X509.Store
 		// TODO: name constraints???
 
 		private X509V2AttributeCertificate attributeCert;
-		private DateTimeObject attributeCertificateValid;
+		private DateTime? attributeCertificateValid;
 		private AttributeCertificateHolder holder;
 		private AttributeCertificateIssuer issuer;
 		private BigInteger serialNumber;
@@ -162,7 +161,7 @@ namespace Org.BouncyCastle.X509.Store
 
 		/// <summary>The criteria for validity</summary>
 		/// <remarks>If <c>null</c> is given any will do.</remarks>
-		public DateTimeObject AttributeCertificateValid
+		public DateTime? AttributeCertificateValid
 		{
 			get { return attributeCertificateValid; }
 			set { this.attributeCertificateValid = value; }
diff --git a/crypto/src/x509/store/X509CertStoreSelector.cs b/crypto/src/x509/store/X509CertStoreSelector.cs
index 71b5419a7..357b5e76d 100644
--- a/crypto/src/x509/store/X509CertStoreSelector.cs
+++ b/crypto/src/x509/store/X509CertStoreSelector.cs
@@ -6,7 +6,6 @@ using Org.BouncyCastle.Asn1.X509;
 using Org.BouncyCastle.Math;
 using Org.BouncyCastle.Utilities;
 using Org.BouncyCastle.Utilities.Collections;
-using Org.BouncyCastle.Utilities.Date;
 using Org.BouncyCastle.X509.Extension;
 
 namespace Org.BouncyCastle.X509.Store
@@ -19,13 +18,13 @@ namespace Org.BouncyCastle.X509.Store
 		private byte[] authorityKeyIdentifier;
 		private int basicConstraints = -1;
 		private X509Certificate certificate;
-		private DateTimeObject certificateValid;
+		private DateTime? certificateValid;
 		private ISet<DerObjectIdentifier> extendedKeyUsage;
         private bool ignoreX509NameOrdering;
 		private X509Name issuer;
 		private bool[] keyUsage;
 		private ISet<DerObjectIdentifier> policy;
-		private DateTimeObject privateKeyValid;
+		private DateTime? privateKeyValid;
 		private BigInteger serialNumber;
 		private X509Name subject;
 		private byte[] subjectKeyIdentifier;
@@ -85,7 +84,7 @@ namespace Org.BouncyCastle.X509.Store
 			set { this.certificate = value; }
 		}
 
-		public DateTimeObject CertificateValid
+		public DateTime? CertificateValid
 		{
 			get { return certificateValid; }
 			set { certificateValid = value; }
@@ -124,7 +123,7 @@ namespace Org.BouncyCastle.X509.Store
 			set { policy = CopySet(value); }
 		}
 
-		public DateTimeObject PrivateKeyValid
+		public DateTime? PrivateKeyValid
 		{
 			get { return privateKeyValid; }
 			set { privateKeyValid = value; }
diff --git a/crypto/src/x509/store/X509CrlStoreSelector.cs b/crypto/src/x509/store/X509CrlStoreSelector.cs
index 365ec1d38..9e84b82ae 100644
--- a/crypto/src/x509/store/X509CrlStoreSelector.cs
+++ b/crypto/src/x509/store/X509CrlStoreSelector.cs
@@ -6,7 +6,6 @@ using Org.BouncyCastle.Asn1.X509;
 using Org.BouncyCastle.Math;
 using Org.BouncyCastle.Utilities;
 using Org.BouncyCastle.Utilities.Collections;
-using Org.BouncyCastle.Utilities.Date;
 using Org.BouncyCastle.X509.Extension;
 
 namespace Org.BouncyCastle.X509.Store
@@ -17,7 +16,7 @@ namespace Org.BouncyCastle.X509.Store
 		// TODO Missing criteria?
 
 		private X509Certificate certificateChecking;
-		private DateTimeObject dateAndTime;
+		private DateTime? dateAndTime;
 		private IList<X509Name> issuers;
 		private BigInteger maxCrlNumber;
 		private BigInteger minCrlNumber;
@@ -61,7 +60,7 @@ namespace Org.BouncyCastle.X509.Store
 			set { certificateChecking = value; }
 		}
 
-		public DateTimeObject DateAndTime
+		public DateTime? DateAndTime
 		{
 			get { return dateAndTime; }
 			set { dateAndTime = value; }
@@ -190,7 +189,7 @@ namespace Org.BouncyCastle.X509.Store
 			{
 				DateTime dt = dateAndTime.Value;
 				DateTime tu = c.ThisUpdate;
-				DateTimeObject nu = c.NextUpdate;
+				DateTime? nu = c.NextUpdate;
 
 				if (dt.CompareTo(tu) < 0 || nu == null || dt.CompareTo(nu.Value) >= 0)
 					return false;