Class CMSCompressedData
java.lang.Object
org.bouncycastle.cms.CMSCompressedData
- All Implemented Interfaces:
org.bouncycastle.util.Encodable
containing class for an CMS Compressed Data object
CMSCompressedData cd = new CMSCompressedData(inputStream);
process(cd.getContent(new ZlibExpanderProvider()));
-
Constructor Summary
ConstructorsConstructorDescriptionCMSCompressedData(byte[] compressedData) Create a CMSCompressedData object from its encoding.CMSCompressedData(InputStream compressedData) Create a CMSCompressedData object from a stream.CMSCompressedData(org.bouncycastle.asn1.cms.ContentInfo contentInfo) Create a CMSCompressedData object from an already-parsed ContentInfo. -
Method Summary
Modifier and TypeMethodDescriptionorg.bouncycastle.asn1.ASN1ObjectIdentifierbyte[]getContent(InputExpanderProvider expanderProvider) Return the uncompressed content.getContentStream(InputExpanderProvider expanderProvider) org.bouncycastle.asn1.ASN1ObjectIdentifierbyte[]return the ASN.1 encoded representation of this object.org.bouncycastle.asn1.cms.ContentInforeturn the ContentInfo
-
Constructor Details
-
CMSCompressedData
Create a CMSCompressedData object from its encoding.- Parameters:
compressedData- the complete encoding of the CompressedData structure (a CMS ContentInfo). The array must hold the entire encoding and nothing extra - trailing bytes beyond the CompressedData are not permitted.- Throws:
CMSException- if the encoding cannot be parsed as a CompressedData.
-
CMSCompressedData
Create a CMSCompressedData object from a stream.- Parameters:
compressedData- a stream positioned at the start of the CompressedData encoding (a CMS ContentInfo).- Throws:
CMSException- if the encoding cannot be parsed as a CompressedData.
-
CMSCompressedData
Create a CMSCompressedData object from an already-parsed ContentInfo.- Parameters:
contentInfo- the ContentInfo carrying the CompressedData.- Throws:
CMSException- if the ContentInfo does not hold a well-formed CompressedData.
-
-
Method Details
-
getContentType
public org.bouncycastle.asn1.ASN1ObjectIdentifier getContentType() -
getCompressedContentType
public org.bouncycastle.asn1.ASN1ObjectIdentifier getCompressedContentType() -
getContentStream
- Throws:
CMSException
-
getContent
Return the uncompressed content.- Parameters:
expanderProvider- a provider of expander algorithm implementations.- Returns:
- the uncompressed content
- Throws:
CMSException- if there is an exception un-compressing the data.
-
toASN1Structure
public org.bouncycastle.asn1.cms.ContentInfo toASN1Structure()return the ContentInfo -
getEncoded
return the ASN.1 encoded representation of this object.- Specified by:
getEncodedin interfaceorg.bouncycastle.util.Encodable- Throws:
IOException
-