01: package org.bouncycastle.sasn1.cms;
02:
03: import org.bouncycastle.sasn1.Asn1Object;
04: import org.bouncycastle.sasn1.Asn1ObjectIdentifier;
05: import org.bouncycastle.sasn1.Asn1Sequence;
06: import org.bouncycastle.sasn1.Asn1TaggedObject;
07:
08: import java.io.IOException;
09:
10: /**
11: * Produce an object suitable for an ASN1OutputStream.
12: * <pre>
13: * ContentInfo ::= SEQUENCE {
14: * contentType ContentType,
15: * content
16: * [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL }
17: * </pre>
18: * @deprecated use corresponding class in org.bouncycastle.asn1.cms
19: */
20: public class ContentInfoParser {
21: private Asn1ObjectIdentifier contentType;
22: private Asn1TaggedObject content;
23:
24: public ContentInfoParser(Asn1Sequence seq) throws IOException {
25: contentType = (Asn1ObjectIdentifier) seq.readObject();
26: content = (Asn1TaggedObject) seq.readObject();
27: }
28:
29: public Asn1ObjectIdentifier getContentType() {
30: return contentType;
31: }
32:
33: public Asn1Object getContent(int tag) throws IOException {
34: if (content != null) {
35: return content.getObject(tag, true);
36: }
37:
38: return null;
39: }
40: }
|