01: package org.bouncycastle.asn1.cms;
02:
03: import org.bouncycastle.asn1.x509.AlgorithmIdentifier;
04: import org.bouncycastle.asn1.DERInteger;
05: import org.bouncycastle.asn1.ASN1SequenceParser;
06:
07: import java.io.IOException;
08:
09: /**
10: * RFC 3274 - CMS Compressed Data.
11: * <pre>
12: * CompressedData ::= SEQUENCE {
13: * version CMSVersion,
14: * compressionAlgorithm CompressionAlgorithmIdentifier,
15: * encapContentInfo EncapsulatedContentInfo
16: * }
17: * </pre>
18: */
19: public class CompressedDataParser {
20: private DERInteger _version;
21: private AlgorithmIdentifier _compressionAlgorithm;
22: private ContentInfoParser _encapContentInfo;
23:
24: public CompressedDataParser(ASN1SequenceParser seq)
25: throws IOException {
26: this ._version = (DERInteger) seq.readObject();
27: this ._compressionAlgorithm = AlgorithmIdentifier
28: .getInstance(seq.readObject().getDERObject());
29: this ._encapContentInfo = new ContentInfoParser(
30: (ASN1SequenceParser) seq.readObject());
31: }
32:
33: public DERInteger getVersion() {
34: return _version;
35: }
36:
37: public AlgorithmIdentifier getCompressionAlgorithmIdentifier() {
38: return _compressionAlgorithm;
39: }
40:
41: public ContentInfoParser getEncapContentInfo() {
42: return _encapContentInfo;
43: }
44: }
|