diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2023-07-20 19:01:12 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2023-07-20 19:01:12 +0700 |
commit | e5d77a0741bcc55088054b2ad4a91ab0508ac092 (patch) | |
tree | 816fc0d1139945ee9bfd22ca40f1e570e816a02f /crypto/src/asn1/cms/TimeStampAndCRL.cs | |
parent | Refactoring in Asn1.Crmf (diff) | |
download | BouncyCastle.NET-ed25519-e5d77a0741bcc55088054b2ad4a91ab0508ac092.tar.xz |
Refactoring in Asn1.Cms
Diffstat (limited to 'crypto/src/asn1/cms/TimeStampAndCRL.cs')
-rw-r--r-- | crypto/src/asn1/cms/TimeStampAndCRL.cs | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/crypto/src/asn1/cms/TimeStampAndCRL.cs b/crypto/src/asn1/cms/TimeStampAndCRL.cs index 4cb5f2a52..c0cd48905 100644 --- a/crypto/src/asn1/cms/TimeStampAndCRL.cs +++ b/crypto/src/asn1/cms/TimeStampAndCRL.cs @@ -1,11 +1,23 @@ -using System; - namespace Org.BouncyCastle.Asn1.Cms { - public class TimeStampAndCrl + public class TimeStampAndCrl : Asn1Encodable { - private ContentInfo timeStamp; + public static TimeStampAndCrl GetInstance(object obj) + { + if (obj == null) + return null; + if (obj is TimeStampAndCrl timeStampAndCrl) + return timeStampAndCrl; + return new TimeStampAndCrl(Asn1Sequence.GetInstance(obj)); + } + + public static TimeStampAndCrl GetInstance(Asn1TaggedObject taggedObject, bool declaredExplicit) + { + return new TimeStampAndCrl(Asn1Sequence.GetInstance(taggedObject, declaredExplicit)); + } + + private ContentInfo timeStamp; private X509.CertificateList crl; public TimeStampAndCrl(ContentInfo timeStamp) @@ -22,17 +34,6 @@ namespace Org.BouncyCastle.Asn1.Cms } } - public static TimeStampAndCrl GetInstance(object obj) - { - if (obj is TimeStampAndCrl) - return (TimeStampAndCrl)obj; - - if (obj != null) - return new TimeStampAndCrl(Asn1Sequence.GetInstance(obj)); - - return null; - } - public virtual ContentInfo TimeStampToken { get { return this.timeStamp; } |