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/TimeStampTokenEvidence.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/TimeStampTokenEvidence.cs')
-rw-r--r-- | crypto/src/asn1/cms/TimeStampTokenEvidence.cs | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/crypto/src/asn1/cms/TimeStampTokenEvidence.cs b/crypto/src/asn1/cms/TimeStampTokenEvidence.cs index 8625d058e..6ac1eb11d 100644 --- a/crypto/src/asn1/cms/TimeStampTokenEvidence.cs +++ b/crypto/src/asn1/cms/TimeStampTokenEvidence.cs @@ -1,11 +1,23 @@ -using System; - namespace Org.BouncyCastle.Asn1.Cms { - public class TimeStampTokenEvidence + public class TimeStampTokenEvidence : Asn1Encodable { - private TimeStampAndCrl[] timeStampAndCrls; + public static TimeStampTokenEvidence GetInstance(object obj) + { + if (obj == null) + return null; + if (obj is TimeStampTokenEvidence timeStampTokenEvidence) + return timeStampTokenEvidence; + return new TimeStampTokenEvidence(Asn1Sequence.GetInstance(obj)); + } + + public static TimeStampTokenEvidence GetInstance(Asn1TaggedObject tagged, bool isExplicit) + { + return new TimeStampTokenEvidence(Asn1Sequence.GetInstance(tagged, isExplicit)); + } + + private TimeStampAndCrl[] timeStampAndCrls; public TimeStampTokenEvidence(TimeStampAndCrl[] timeStampAndCrls) { @@ -29,23 +41,7 @@ namespace Org.BouncyCastle.Asn1.Cms } } - public static TimeStampTokenEvidence GetInstance(Asn1TaggedObject tagged, bool isExplicit) - { - return GetInstance(Asn1Sequence.GetInstance(tagged, isExplicit)); - } - - public static TimeStampTokenEvidence GetInstance(object obj) - { - if (obj is TimeStampTokenEvidence) - return (TimeStampTokenEvidence)obj; - - if (obj != null) - return new TimeStampTokenEvidence(Asn1Sequence.GetInstance(obj)); - - return null; - } - - public virtual TimeStampAndCrl[] ToTimeStampAndCrlArray() + public virtual TimeStampAndCrl[] ToTimeStampAndCrlArray() { return (TimeStampAndCrl[])timeStampAndCrls.Clone(); } |