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