2 package org.bouncycastle.asn1.x509;
4 import org.bouncycastle.asn1.*;
9 * The X.509 v2 CRL syntax is as follows. For signature calculation,
10 * the data that is to be signed is ASN.1 DER encoded.
13 * CertificateList ::= SEQUENCE {
14 * tbsCertList TBSCertList,
15 * signatureAlgorithm AlgorithmIdentifier,
16 * signatureValue BIT STRING }
19 public class CertificateList
20 implements DEREncodable
22 TBSCertList tbsCertList;
23 AlgorithmIdentifier sigAlgId;
26 public static CertificateList getInstance(
30 return getInstance(ASN1Sequence.getInstance(obj, explicit));
33 public static CertificateList getInstance(
36 if (obj instanceof CertificateList)
38 return (CertificateList)obj;
40 else if (obj instanceof ASN1Sequence)
42 return new CertificateList((ASN1Sequence)obj);
45 throw new IllegalArgumentException("unknown object in factory");
48 public CertificateList(
51 tbsCertList = TBSCertList.getInstance(seq.getObjectAt(0));
52 sigAlgId = AlgorithmIdentifier.getInstance(seq.getObjectAt(1));
53 sig = (DERBitString)seq.getObjectAt(2);
56 public TBSCertList getTBSCertList()
61 public TBSCertList.CRLEntry[] getRevokedCertificates()
63 return tbsCertList.getRevokedCertificates();
66 public AlgorithmIdentifier getSignatureAlgorithm()
71 public DERBitString getSignature()
76 public int getVersion()
78 return tbsCertList.getVersion();
81 public X509Name getIssuer()
83 return tbsCertList.getIssuer();
86 public Time getThisUpdate()
88 return tbsCertList.getThisUpdate();
91 public Time getNextUpdate()
93 return tbsCertList.getNextUpdate();
96 public DERObject getDERObject()
98 DERConstructedSequence seq = new DERConstructedSequence();
99 seq.addObject(tbsCertList);
100 seq.addObject(sigAlgId);