public class CompressedDataDemo extends java.lang.Object
CompressedDataStream and
CompressedData for compressing/decompressing data using
the CMS type CompressedData.| Constructor and Description |
|---|
CompressedDataDemo()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
createCompressedData(byte[] message,
int mode)
Creates a CMS
CompressedData object. |
byte[] |
createCompressedDataStream(byte[] message,
int mode)
Creates a CMS
CompressedData object. |
byte[] |
getCompressedData(byte[] encoding,
byte[] compressedContent)
Parses a CMS
CompressedData object. |
byte[] |
getCompressedDataStream(byte[] encoding,
byte[] compressedContent)
Parses a CMS
CompressedData object. |
static void |
main(java.lang.String[] argv)
Main method.
|
void |
start()
Starts the demo.
|
public CompressedDataDemo()
public byte[] createCompressedDataStream(byte[] message, int mode) throws iaik.cms.CMSException, java.io.IOException, java.security.NoSuchAlgorithmException
CompressedData object.
message - the message to be compressed, as byte representationmode - IMPLICIT (include compressed content) or
EXPLICIT (do not include compressed content)CompressedData object just creatediaik.cms.CMSException - if the CompressedData object cannot
be createdjava.io.IOException - if an I/O error occursjava.security.NoSuchAlgorithmException - if the compression algorithm is not supportedpublic byte[] getCompressedDataStream(byte[] encoding, byte[] compressedContent) throws iaik.cms.CMSException, java.io.IOException, java.security.NoSuchAlgorithmException
CompressedData object.encoding - the CompressedData object as BER encoded byte arraycompressedContent - the compressed content which was transmitted out-of-bandiaik.cms.CMSException - if the CompressedData cannot be parsedjava.io.IOException - if an I/O error occursjava.security.NoSuchAlgorithmException - if the compression algorithm is not supportedpublic byte[] createCompressedData(byte[] message, int mode) throws iaik.cms.CMSException, java.io.IOException, java.security.NoSuchAlgorithmException
CompressedData object.
message - the message to be compressed, as byte representationmode - IMPLICIT (include the compressed content) or
EXPLICIT (do not include the compressed content)CompressedDataiaik.cms.CMSException - if the CompressedData object cannot
be createdjava.io.IOException - if an I/O error occursjava.security.NoSuchAlgorithmException - if the compression algorithm is not supportedpublic byte[] getCompressedData(byte[] encoding, byte[] compressedContent) throws iaik.cms.CMSException, java.io.IOException, java.security.NoSuchAlgorithmException
CompressedData object.encoding - the DER encoded CompressedData objectcompressedContent - the compressed content which was transmitted out-of-bandiaik.cms.CMSException - if the CompressedData cannot be parsedjava.io.IOException - if an I/O error occursjava.security.NoSuchAlgorithmException - if the compression algorithm is not supportedpublic void start()
public static void main(java.lang.String[] argv) throws java.lang.Exception
java.lang.Exception