GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
CMS_COMPRESS(3) FreeBSD Library Functions Manual CMS_COMPRESS(3)

CMS_compresscreate a CMS CompressedData structure

#include <openssl/cms.h>

CMS_ContentInfo *
CMS_compress(BIO *in, int comp_nid, unsigned int flags);

() creates and returns a CMS CompressedData structure.

comp_nid is the compression algorithm to use or NID_undef to use the default algorithm. Currently, the default algorithm NID_zlib_compression is the only supported algorithm. If zlib support is not compiled in, () always returns an error.

in provides the content to be compressed.

Any of the following flags (OR'ed together) can be passed in the flags parameter:

Prepend MIME headers for type text/plain to the data.
Do not translate the supplied content into MIME canonical format, even though that is required by the S/MIME specifications. This option should be used if the supplied data is in binary format. Otherwise, the translation will corrupt it. If CMS_BINARY is set, CMS_TEXT is ignored.
Return a partial CMS_ContentInfo structure suitable for streaming I/O: no data is read from in. Several functions including SMIME_write_CMS(3), i2d_CMS_bio_stream(3), or PEM_write_bio_CMS_stream(3) can be used to finalize the structure. Alternatively, finalization can be performed by obtaining the streaming ASN1 BIO directly using BIO_new_CMS(3). Outputting the contents of the CMS_ContentInfo structure via a function that does not properly finalize it will give unpredictable results.
Do not include the compressed data in the CMS_ContentInfo structure. This is rarely used in practice and is not supported by SMIME_write_CMS(3).

Additional compression parameters such as the zlib compression level cannot currently be set.

CMS_compress() returns either a CMS_ContentInfo structure or NULL if an error occurred. The error can be obtained from ERR_get_error(3).

CMS_ContentInfo_new(3), CMS_uncompress(3)

RFC 3274: Compressed Data Content Type for Cryptographic Message Syntax (CMS)

CMS_compress() first appeared in OpenSSL 0.9.8h and has been available since OpenBSD 6.7.

The CMS_STREAM flag first appeared in OpenSSL 1.0.0.

November 2, 2019 FreeBSD 14.3-RELEASE

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.