/// <summary>
        /// Compress the specified stream.
        /// </summary>
        /// <returns>A new <see cref="MimeKit.Cryptography.ApplicationPkcs7Mime"/> instance
        /// containing the compressed content.</returns>
        /// <param name="stream">The stream to compress.</param>
        /// <exception cref="System.ArgumentNullException">
        /// <paramref name="stream"/> is <c>null</c>.
        /// </exception>
        /// <exception cref="Org.BouncyCastle.Cms.CmsException">
        /// An error occurred in the cryptographic message syntax subsystem.
        /// </exception>
        public ApplicationPkcs7Mime Compress(Stream stream)
        {
            if (stream == null)
                throw new ArgumentNullException ("stream");

            var compresser = new CmsCompressedDataGenerator ();
            var processable = new CmsProcessableInputStream (stream);
            var compressed = compresser.Generate (processable, CmsCompressedDataGenerator.ZLib);
            var encoded = compressed.GetEncoded ();

            return new ApplicationPkcs7Mime (SecureMimeType.CompressedData, new MemoryStream (encoded, false));
        }
		private CmsCompressedData GetStdData()
		{
			CmsProcessableByteArray testData = new CmsProcessableByteArray(TEST_DATA);
			CmsCompressedDataGenerator gen = new CmsCompressedDataGenerator();
			return gen.Generate(testData, CmsCompressedDataGenerator.ZLib);
		}