diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-09-14 14:23:01 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-09-14 14:23:01 +0700 |
commit | 3124e402477d36636fad5ac3036ef56088cecf65 (patch) | |
tree | ae4c5b178e87d8fabd4feff0609448abb3d5dc3a /crypto/test | |
parent | added Dilithium ack (diff) | |
download | BouncyCastle.NET-ed25519-3124e402477d36636fad5ac3036ef56088cecf65.tar.xz |
DateTimeObject => nullable DateTime
Diffstat (limited to 'crypto/test')
-rw-r--r-- | crypto/test/src/test/AttrCertSelectorTest.cs | 3 | ||||
-rw-r--r-- | crypto/test/src/test/CertPathBuilderTest.cs | 5 | ||||
-rw-r--r-- | crypto/test/src/test/CertPathValidatorTest.cs | 7 | ||||
-rw-r--r-- | crypto/test/src/test/X509StoreTest.cs | 7 | ||||
-rw-r--r-- | crypto/test/src/test/nist/NistCertPathTest.cs | 5 | ||||
-rw-r--r-- | crypto/test/src/test/nist/NistCertPathTest2.cs | 5 | ||||
-rw-r--r-- | crypto/test/src/tsp/test/NewTspTest.cs | 5 |
7 files changed, 15 insertions, 22 deletions
diff --git a/crypto/test/src/test/AttrCertSelectorTest.cs b/crypto/test/src/test/AttrCertSelectorTest.cs index cb5de3740..1e82f810c 100644 --- a/crypto/test/src/test/AttrCertSelectorTest.cs +++ b/crypto/test/src/test/AttrCertSelectorTest.cs @@ -8,7 +8,6 @@ using Org.BouncyCastle.Crypto; using Org.BouncyCastle.Crypto.Operators; using Org.BouncyCastle.Crypto.Parameters; using Org.BouncyCastle.Math; -using Org.BouncyCastle.Utilities.Date; using Org.BouncyCastle.Utilities.Encoders; using Org.BouncyCastle.Utilities.Test; using Org.BouncyCastle.X509; @@ -177,7 +176,7 @@ namespace Org.BouncyCastle.Tests Fail("Selector does not match attribute certificate serial number."); } - sel.AttributeCertificateValid = new DateTimeObject(DateTime.UtcNow); + sel.AttributeCertificateValid = DateTime.UtcNow; match = sel.Match(aCert); if (!match) { diff --git a/crypto/test/src/test/CertPathBuilderTest.cs b/crypto/test/src/test/CertPathBuilderTest.cs index 305832ff3..35e73f9bb 100644 --- a/crypto/test/src/test/CertPathBuilderTest.cs +++ b/crypto/test/src/test/CertPathBuilderTest.cs @@ -7,7 +7,6 @@ using Org.BouncyCastle.Crypto; using Org.BouncyCastle.Math; using Org.BouncyCastle.Pkix; using Org.BouncyCastle.Utilities.Collections; -using Org.BouncyCastle.Utilities.Date; using Org.BouncyCastle.Utilities.Test; using Org.BouncyCastle.X509; using Org.BouncyCastle.X509.Store; @@ -57,7 +56,7 @@ namespace Org.BouncyCastle.Tests PkixBuilderParameters parameters = new PkixBuilderParameters(trust, targetConstraints); parameters.AddStoreCert(x509CertStore); parameters.AddStoreCrl(x509CrlStore); - parameters.Date = new DateTimeObject(validDate); + parameters.Date = validDate; PkixCertPathBuilderResult result = cpb.Build(parameters); PkixCertPath path = result.CertPath; @@ -108,7 +107,7 @@ namespace Org.BouncyCastle.Tests buildParams.AddStoreCert(x509CertStore); buildParams.AddStoreCrl(x509CrlStore); - buildParams.Date = new DateTimeObject(DateTime.UtcNow); + buildParams.Date = DateTime.UtcNow; PkixCertPathBuilderResult result = builder.Build(buildParams); PkixCertPath path = result.CertPath; diff --git a/crypto/test/src/test/CertPathValidatorTest.cs b/crypto/test/src/test/CertPathValidatorTest.cs index 3c4577d59..d57d90acf 100644 --- a/crypto/test/src/test/CertPathValidatorTest.cs +++ b/crypto/test/src/test/CertPathValidatorTest.cs @@ -6,7 +6,6 @@ using NUnit.Framework; using Org.BouncyCastle.Crypto; using Org.BouncyCastle.Pkix; using Org.BouncyCastle.Utilities.Collections; -using Org.BouncyCastle.Utilities.Date; using Org.BouncyCastle.Utilities.Encoders; using Org.BouncyCastle.Utilities.Test; using Org.BouncyCastle.X509; @@ -165,7 +164,7 @@ namespace Org.BouncyCastle.Tests PkixParameters param = new PkixParameters(trust); param.AddStoreCert(x509CertStore); param.AddStoreCrl(x509CrlStore); - param.Date = new DateTimeObject(validDate); + param.Date = validDate; MyChecker checker = new MyChecker(); param.AddCertPathChecker(checker); @@ -197,7 +196,7 @@ namespace Org.BouncyCastle.Tests param = new PkixParameters(trust); param.AddStoreCert(x509CertStore); param.AddStoreCrl(x509CrlStore); - param.Date = new DateTimeObject(validDate); + param.Date = validDate; checker = new MyChecker(); param.AddCertPathChecker(checker); @@ -239,7 +238,7 @@ namespace Org.BouncyCastle.Tests param = new PkixParameters(trust); param.AddStoreCert(x509CertStore); param.IsRevocationEnabled = false; - param.Date = new DateTimeObject(validDate); + param.Date = validDate; result = cpv.Validate(cp, param); policyTree = result.PolicyTree; diff --git a/crypto/test/src/test/X509StoreTest.cs b/crypto/test/src/test/X509StoreTest.cs index aada53e4e..2a8d44424 100644 --- a/crypto/test/src/test/X509StoreTest.cs +++ b/crypto/test/src/test/X509StoreTest.cs @@ -6,7 +6,6 @@ using NUnit.Framework; using Org.BouncyCastle.Asn1.X509; using Org.BouncyCastle.Math; using Org.BouncyCastle.Utilities.Collections; -using Org.BouncyCastle.Utilities.Date; using Org.BouncyCastle.Utilities.Test; using Org.BouncyCastle.X509; using Org.BouncyCastle.X509.Store; @@ -230,7 +229,7 @@ namespace Org.BouncyCastle.Tests } attrSelector = new X509AttrCertStoreSelector(); - attrSelector.AttributeCertificateValid = new DateTimeObject(attrCert.NotBefore); + attrSelector.AttributeCertificateValid = attrCert.NotBefore; if (attrSelector.AttributeCertificateValid.Value != attrCert.NotBefore) { Fail("valid get not correct"); @@ -241,13 +240,13 @@ namespace Org.BouncyCastle.Tests Fail("attrCert not found on valid"); } attrSelector = new X509AttrCertStoreSelector(); - attrSelector.AttributeCertificateValid = new DateTimeObject(attrCert.NotBefore.AddMilliseconds(-100)); + attrSelector.AttributeCertificateValid = attrCert.NotBefore.AddMilliseconds(-100); attrs = new List<X509V2AttributeCertificate>(attrStore.EnumerateMatches(attrSelector)); if (attrs.Count != 0) { Fail("attrCert found on before"); } - attrSelector.AttributeCertificateValid = new DateTimeObject(attrCert.NotAfter.AddMilliseconds(100)); + attrSelector.AttributeCertificateValid = attrCert.NotAfter.AddMilliseconds(100); attrs = new List<X509V2AttributeCertificate>(attrStore.EnumerateMatches(attrSelector)); if (attrs.Count != 0) { diff --git a/crypto/test/src/test/nist/NistCertPathTest.cs b/crypto/test/src/test/nist/NistCertPathTest.cs index 4a6391e8f..bdcd1b51f 100644 --- a/crypto/test/src/test/nist/NistCertPathTest.cs +++ b/crypto/test/src/test/nist/NistCertPathTest.cs @@ -8,7 +8,6 @@ using Org.BouncyCastle.Asn1; using Org.BouncyCastle.Asn1.X509; using Org.BouncyCastle.Pkix; using Org.BouncyCastle.Utilities.Collections; -using Org.BouncyCastle.Utilities.Date; using Org.BouncyCastle.Utilities.Test; using Org.BouncyCastle.X509; using Org.BouncyCastle.X509.Extension; @@ -682,7 +681,7 @@ namespace Org.BouncyCastle.Tests.Nist } // Perform validation as of this date since test certs expired - parameters.Date = new DateTimeObject(DateTime.Parse("1/1/2011")); + parameters.Date = DateTime.Parse("1/1/2011"); return validator.Validate(certPath, parameters); } @@ -743,7 +742,7 @@ namespace Org.BouncyCastle.Tests.Nist builderParams.AddStoreCrl(x509CrlStore); // Perform validation as of this date since test certs expired - builderParams.Date = new DateTimeObject(DateTime.Parse("1/1/2011")); + builderParams.Date = DateTime.Parse("1/1/2011"); try { diff --git a/crypto/test/src/test/nist/NistCertPathTest2.cs b/crypto/test/src/test/nist/NistCertPathTest2.cs index 1bc40e805..e8b2e575c 100644 --- a/crypto/test/src/test/nist/NistCertPathTest2.cs +++ b/crypto/test/src/test/nist/NistCertPathTest2.cs @@ -7,7 +7,6 @@ using Org.BouncyCastle.Asn1; using Org.BouncyCastle.Asn1.X509; using Org.BouncyCastle.Pkix; using Org.BouncyCastle.Utilities.Collections; -using Org.BouncyCastle.Utilities.Date; using Org.BouncyCastle.Utilities.Test; using Org.BouncyCastle.X509; using Org.BouncyCastle.X509.Extension; @@ -349,7 +348,7 @@ namespace Org.BouncyCastle.Tests.Nist } // Perform validation as of this date since test certs expired - parameters.Date = new DateTimeObject(DateTime.Parse("1/1/2011")); + parameters.Date = DateTime.Parse("1/1/2011"); return validator.Validate(certPath, parameters); } @@ -410,7 +409,7 @@ namespace Org.BouncyCastle.Tests.Nist builderParams.AddStoreCrl(x509CrlStore); // Perform validation as of this date since test certs expired - builderParams.Date = new DateTimeObject(DateTime.Parse("1/1/2011")); + builderParams.Date = DateTime.Parse("1/1/2011"); try { diff --git a/crypto/test/src/tsp/test/NewTspTest.cs b/crypto/test/src/tsp/test/NewTspTest.cs index f6d45ef09..01dbc0e13 100644 --- a/crypto/test/src/tsp/test/NewTspTest.cs +++ b/crypto/test/src/tsp/test/NewTspTest.cs @@ -17,7 +17,6 @@ using Org.BouncyCastle.Crypto.Operators; using Org.BouncyCastle.Math; using Org.BouncyCastle.Utilities; using Org.BouncyCastle.Utilities.Collections; -using Org.BouncyCastle.Utilities.Date; using Org.BouncyCastle.Utilities.Test; using Org.BouncyCastle.X509; @@ -86,7 +85,7 @@ namespace Org.BouncyCastle.Tsp.Tests extensionsGenerator.AddExtension(X509Extensions.AuditIdentity, false, new DerUtf8String("Test")); - TimeStampResponse tsResp = tsRespGen.GenerateGrantedResponse(request, new BigInteger("23"), new DateTimeObject( DateTime.UtcNow), "Okay", extensionsGenerator.Generate()); + TimeStampResponse tsResp = tsRespGen.GenerateGrantedResponse(request, new BigInteger("23"), DateTime.UtcNow, "Okay", extensionsGenerator.Generate()); tsResp = new TimeStampResponse(tsResp.GetEncoded()); @@ -473,7 +472,7 @@ namespace Org.BouncyCastle.Tsp.Tests // tsResp = tsRespGen.Generate(request, new BigInteger("23"), null); - + tsResp = new TimeStampResponse(tsResp.GetEncoded()); TimeStampToken tsToken = tsResp.TimeStampToken; |