diff options
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(); } |