01: package org.bouncycastle.asn1.cmp;
02:
03: import org.bouncycastle.asn1.ASN1Encodable;
04: import org.bouncycastle.asn1.ASN1Sequence;
05: import org.bouncycastle.asn1.DERObject;
06: import org.bouncycastle.asn1.x509.CertificateList;
07:
08: public class CRLAnnContent extends ASN1Encodable {
09: private ASN1Sequence content;
10:
11: private CRLAnnContent(ASN1Sequence seq) {
12: content = seq;
13: }
14:
15: public static CRLAnnContent getInstance(Object o) {
16: if (o instanceof CRLAnnContent) {
17: return (CRLAnnContent) o;
18: }
19:
20: if (o instanceof ASN1Sequence) {
21: return new CRLAnnContent((ASN1Sequence) o);
22: }
23:
24: throw new IllegalArgumentException("Invalid object: "
25: + o.getClass().getName());
26: }
27:
28: public CertificateList[] toCertificateListArray() {
29: CertificateList[] result = new CertificateList[content.size()];
30:
31: for (int i = 0; i != result.length; i++) {
32: result[i] = CertificateList.getInstance(content
33: .getObjectAt(i));
34: }
35:
36: return result;
37: }
38:
39: /**
40: * <pre>
41: * CRLAnnContent ::= SEQUENCE OF CertificateList
42: * </pre>
43: * @return a basic ASN.1 object representation.
44: */
45: public DERObject toASN1Object() {
46: return content;
47: }
48: }
|