TimeStampTokenEvidence.cs
1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
using System;
namespace Org.BouncyCastle.Asn1.Cms
{
public class TimeStampTokenEvidence
: Asn1Encodable
{
private TimeStampAndCrl[] timeStampAndCrls;
public TimeStampTokenEvidence(TimeStampAndCrl[] timeStampAndCrls)
{
this.timeStampAndCrls = timeStampAndCrls;
}
public TimeStampTokenEvidence(TimeStampAndCrl timeStampAndCrl)
{
this.timeStampAndCrls = new TimeStampAndCrl[]{ timeStampAndCrl };
}
private TimeStampTokenEvidence(Asn1Sequence seq)
{
this.timeStampAndCrls = new TimeStampAndCrl[seq.Count];
int count = 0;
foreach (Asn1Encodable ae in seq)
{
this.timeStampAndCrls[count++] = TimeStampAndCrl.GetInstance(ae.ToAsn1Object());
}
}
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()
{
return (TimeStampAndCrl[])timeStampAndCrls.Clone();
}
/**
* <pre>
* TimeStampTokenEvidence ::=
* SEQUENCE SIZE(1..MAX) OF TimeStampAndCrl
* </pre>
* @return
*/
public override Asn1Object ToAsn1Object()
{
return new DerSequence(timeStampAndCrls);
}
}
}