blob: 5d73cf41105ef829fa0c7c6fa4d231742586d3f1 (
plain) (
blame)
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
using System;
using System.Collections.Generic;
namespace Org.BouncyCastle.Asn1.X509
{
/**
* PKIX RFC-2459
*
* The X.509 v2 CRL syntax is as follows. For signature calculation,
* the data that is to be signed is ASN.1 Der encoded.
*
* <pre>
* CertificateList ::= Sequence {
* tbsCertList TbsCertList,
* signatureAlgorithm AlgorithmIdentifier,
* signatureValue BIT STRING }
* </pre>
*/
public class CertificateList
: Asn1Encodable
{
private readonly TbsCertificateList tbsCertList;
private readonly AlgorithmIdentifier sigAlgID;
private readonly DerBitString sig;
public static CertificateList GetInstance(Asn1TaggedObject obj, bool explicitly)
{
return GetInstance(Asn1Sequence.GetInstance(obj, explicitly));
}
public static CertificateList GetInstance(object obj)
{
if (obj == null)
return null;
if (obj is CertificateList certificateList)
return certificateList;
return new CertificateList(Asn1Sequence.GetInstance(obj));
}
private CertificateList(
Asn1Sequence seq)
{
if (seq.Count != 3)
throw new ArgumentException("sequence wrong size for CertificateList", "seq");
tbsCertList = TbsCertificateList.GetInstance(seq[0]);
sigAlgID = AlgorithmIdentifier.GetInstance(seq[1]);
sig = DerBitString.GetInstance(seq[2]);
}
public TbsCertificateList TbsCertList
{
get { return tbsCertList; }
}
public CrlEntry[] GetRevokedCertificates()
{
return tbsCertList.GetRevokedCertificates();
}
public IEnumerable<CrlEntry> GetRevokedCertificateEnumeration()
{
return tbsCertList.GetRevokedCertificateEnumeration();
}
public AlgorithmIdentifier SignatureAlgorithm
{
get { return sigAlgID; }
}
public DerBitString Signature
{
get { return sig; }
}
public byte[] GetSignatureOctets()
{
return sig.GetOctets();
}
public int Version
{
get { return tbsCertList.Version; }
}
public X509Name Issuer
{
get { return tbsCertList.Issuer; }
}
public Time ThisUpdate
{
get { return tbsCertList.ThisUpdate; }
}
public Time NextUpdate
{
get { return tbsCertList.NextUpdate; }
}
public override Asn1Object ToAsn1Object()
{
return new DerSequence(tbsCertList, sigAlgID, sig);
}
}
}
|