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