Contact Us Forum Customers Area

DidiSoft Ltd.

Set compression

By default DidiSoft OpenPGP Library for .NET uses ZIP compression when encrypting and signing data. This can be changed through the property PGPLib.Compression. The supported options are listed in the CompressionAlgorithm enum:

CompressionAlgorithm.ZIP
CompressionAlgorithm.ZLIB
CompressionAlgorithm.BZIP2 
CompressionAlgorithm.UNCOMPRESSED

The change has effect only on the current instance of the PGPLib object. For each new instance the preferred compression should be set explicitly. The example below shows how to set the compression to ZLib:

C#

PGPLib pgp = new PGPLib();
pgp.Compression = CompressionAlgorithm.ZLIB;

VB.NET

Dim pgp As New PGPLib()
pgp.Compression = CompressionAlgorithm.ZLIB

<< Back to Examples