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:
07: public class CertConfirmContent extends ASN1Encodable {
08: private ASN1Sequence content;
09:
10: private CertConfirmContent(ASN1Sequence seq) {
11: content = seq;
12: }
13:
14: public static CertConfirmContent getInstance(Object o) {
15: if (o instanceof CertConfirmContent) {
16: return (CertConfirmContent) o;
17: }
18:
19: if (o instanceof ASN1Sequence) {
20: return new CertConfirmContent((ASN1Sequence) o);
21: }
22:
23: throw new IllegalArgumentException("Invalid object: "
24: + o.getClass().getName());
25: }
26:
27: public CertStatus[] toCertStatusArray() {
28: CertStatus[] result = new CertStatus[content.size()];
29:
30: for (int i = 0; i != result.length; i++) {
31: result[i] = CertStatus.getInstance(content.getObjectAt(i));
32: }
33:
34: return result;
35: }
36:
37: /**
38: * <pre>
39: * CertConfirmContent ::= SEQUENCE OF CertStatus
40: * </pre>
41: * @return a basic ASN.1 object representation.
42: */
43: public DERObject toASN1Object() {
44: return content;
45: }
46: }
|