summary refs log tree commit diff
path: root/crypto/src/asn1/crmf/OptionalValidity.cs
diff options
context:
space:
mode:
authorOren Novotny <oren@novotny.org>2014-08-26 17:39:02 -0400
committerOren Novotny <oren@novotny.org>2014-08-26 17:39:02 -0400
commit6dbc12162af086bbcfbd583dcaa8144d049c7fcc (patch)
tree3cf9443720ad508eb5ff615130d57fc118cb7145 /crypto/src/asn1/crmf/OptionalValidity.cs
parentrename Crypto dir to crypto to match bc-git (diff)
parentRework the nonce-random initialisation and avoid GenerateSeed (diff)
downloadBouncyCastle.NET-ed25519-6dbc12162af086bbcfbd583dcaa8144d049c7fcc.tar.xz
Merge in bc-git to this repo
Diffstat (limited to 'crypto/src/asn1/crmf/OptionalValidity.cs')
-rw-r--r--crypto/src/asn1/crmf/OptionalValidity.cs15
1 files changed, 11 insertions, 4 deletions
diff --git a/crypto/src/asn1/crmf/OptionalValidity.cs b/crypto/src/asn1/crmf/OptionalValidity.cs
index c0037999a..d1a0f7ffb 100644
--- a/crypto/src/asn1/crmf/OptionalValidity.cs
+++ b/crypto/src/asn1/crmf/OptionalValidity.cs
@@ -27,13 +27,20 @@ namespace Org.BouncyCastle.Asn1.Crmf
 
         public static OptionalValidity GetInstance(object obj)
         {
-            if (obj is OptionalValidity)
+            if (obj == null || obj is OptionalValidity)
                 return (OptionalValidity)obj;
 
-            if (obj is Asn1Sequence)
-                return new OptionalValidity((Asn1Sequence)obj);
+            return new OptionalValidity(Asn1Sequence.GetInstance(obj));
+        }
 
-            throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj");
+        public virtual Time NotBefore
+        {
+            get { return notBefore; }
+        }
+
+        public virtual Time NotAfter
+        {
+            get { return notAfter; }
         }
 
         /**