Discuss this help topic in SecureBlackbox Forum

Compress data with TElMessageCompressor

TElMessageCompressor is an easy-to-use class that allows to quickly compress a piece of arbitrary data. Unlike ZIP components, TElMessageCompressor (and TElMessageDecompressor) works with uninterpreted streams/arrays of data, and generates PKCS#7 CompressedData structures on output.

Compressing data with TElMessageCompressor is fairly easy:
  1. Create an instance of TElMessageCompressor class.
  2. Optionally, configure the component by setting its ContentType (data type identifier, should be a valid OID) and CompressionLevel (1-9) properties.
  3. Pass your data to the Compress() method and obtain the compressed data on its output: int res = compressor.Compress(sourceData, compressedData); Always check the return value of the Compress() method. The return value of 0 indicates successful completion of the method; any other value represents an error code.

How To articles about PKCS7 signing and encryption

Discuss this help topic in SecureBlackbox Forum