Evidence.cs
1006 Bytes
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
using System;
using Org.BouncyCastle.Utilities;
namespace Org.BouncyCastle.Asn1.Cms
{
public class Evidence
: Asn1Encodable, IAsn1Choice
{
private TimeStampTokenEvidence tstEvidence;
public Evidence(TimeStampTokenEvidence tstEvidence)
{
this.tstEvidence = tstEvidence;
}
private Evidence(Asn1TaggedObject tagged)
{
if (tagged.TagNo == 0)
{
this.tstEvidence = TimeStampTokenEvidence.GetInstance(tagged, false);
}
}
public static Evidence GetInstance(object obj)
{
if (obj is Evidence)
return (Evidence)obj;
if (obj is Asn1TaggedObject)
return new Evidence(Asn1TaggedObject.GetInstance(obj));
throw new ArgumentException("Unknown object in GetInstance: " + Platform.GetTypeName(obj), "obj");
}
public virtual TimeStampTokenEvidence TstEvidence
{
get { return tstEvidence; }
}
public override Asn1Object ToAsn1Object()
{
if (tstEvidence != null)
return new DerTaggedObject(false, 0, tstEvidence);
return null;
}
}
}