| CMS_COMPRESS(3) | Library Functions Manual | CMS_COMPRESS(3) |
CMS_compress —
create a CMS CompressedData structure
#include
<openssl/cms.h>
CMS_ContentInfo *
CMS_compress(BIO *in,
int comp_nid, unsigned int
flags);
CMS_compress()
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,
CMS_compress()
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:
CMS_TEXTCMS_BINARYCMS_BINARY is set,
CMS_TEXT is ignored.CMS_STREAMCMS_DETACHEDAdditional 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).
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 | openbsd |