01: package org.bouncycastle.asn1.pkcs;
02:
03: import org.bouncycastle.asn1.ASN1Encodable;
04: import org.bouncycastle.asn1.ASN1EncodableVector;
05: import org.bouncycastle.asn1.ASN1Sequence;
06: import org.bouncycastle.asn1.BERSequence;
07: import org.bouncycastle.asn1.DERObject;
08:
09: public class AuthenticatedSafe extends ASN1Encodable {
10: ContentInfo[] info;
11:
12: public AuthenticatedSafe(ASN1Sequence seq) {
13: info = new ContentInfo[seq.size()];
14:
15: for (int i = 0; i != info.length; i++) {
16: info[i] = ContentInfo.getInstance(seq.getObjectAt(i));
17: }
18: }
19:
20: public AuthenticatedSafe(ContentInfo[] info) {
21: this .info = info;
22: }
23:
24: public ContentInfo[] getContentInfo() {
25: return info;
26: }
27:
28: public DERObject toASN1Object() {
29: ASN1EncodableVector v = new ASN1EncodableVector();
30:
31: for (int i = 0; i != info.length; i++) {
32: v.add(info[i]);
33: }
34:
35: return new BERSequence(v);
36: }
37: }
|