Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

cms_uncompress(3) [centos man page]

CMS_uncompress(3)						      OpenSSL							 CMS_uncompress(3)

NAME
CMS_uncompress - uncompress a CMS CompressedData structure SYNOPSIS
#include <openssl/cms.h> int CMS_uncompress(CMS_ContentInfo *cms, BIO *dcont, BIO *out, unsigned int flags); DESCRIPTION
CMS_uncompress() extracts and uncompresses the content from a CMS CompressedData structure cms. data is a BIO to write the content to and flags is an optional set of flags. The dcont parameter is used in the rare case where the compressed content is detached. It will normally be set to NULL. NOTES
The only currently supported compression algorithm is zlib: if the structure indicates the use of any other algorithm an error is returned. If zlib support is not compiled into OpenSSL then CMS_uncompress() will always return an error. The following flags can be passed in the flags parameter. If the CMS_TEXT flag is set MIME headers for type text/plain are deleted from the content. If the content is not of type text/plain then an error is returned. RETURN VALUES
CMS_uncompress() returns either 1 for success or 0 for failure. The error can be obtained from ERR_get_error(3) BUGS
The lack of single pass processing and the need to hold all data in memory as mentioned in CMS_verify() also applies to CMS_decompress(). SEE ALSO
ERR_get_error(3), CMS_compress(3) HISTORY
CMS_uncompress() was added to OpenSSL 0.9.8 1.0.1e 2013-02-11 CMS_uncompress(3)

Check Out this Related Man Page

CMS_compress(3SSL)						      OpenSSL							CMS_compress(3SSL)

NAME
CMS_compress - create a CMS CompressedData structure SYNOPSIS
#include <openssl/cms.h> CMS_ContentInfo *CMS_compress(BIO *in, int comp_nid, unsigned int flags); DESCRIPTION
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 (zlib compression). in is the content to be compressed. flags is an optional set of flags. NOTES
The only currently supported compression algorithm is zlib using the NID NID_zlib_compression. If zlib support is not compiled into OpenSSL then CMS_compress() will return an error. If the CMS_TEXT flag is set MIME headers for type text/plain are prepended to the data. Normally the supplied content is translated into MIME canonical format (as required by the S/MIME specifications) if CMS_BINARY is set no translation occurs. This option should be used if the supplied data is in binary format otherwise the translation will corrupt it. If CMS_BINARY is set then CMS_TEXT is ignored. If the CMS_STREAM flag is set a partial CMS_ContentInfo structure is returned suitable for streaming I/O: no data is read from the BIO in. The compressed data is included in the CMS_ContentInfo structure, unless CMS_DETACHED is set in which case it is omitted. This is rarely used in practice and is not supported by SMIME_write_CMS(). NOTES
If the flag CMS_STREAM is set the returned CMS_ContentInfo structure is not complete and outputting its contents via a function that does not properly finalize the CMS_ContentInfo structure will give unpredictable results. Several functions including SMIME_write_CMS(), i2d_CMS_bio_stream(), PEM_write_bio_CMS_stream() finalize the structure. Alternatively finalization can be performed by obtaining the streaming ASN1 BIO directly using BIO_new_CMS(). Additional compression parameters such as the zlib compression level cannot currently be set. RETURN VALUES
CMS_compress() returns either a CMS_ContentInfo structure or NULL if an error occurred. The error can be obtained from ERR_get_error(3). SEE ALSO
ERR_get_error(3), CMS_uncompress(3) HISTORY
CMS_compress() was added to OpenSSL 0.9.8 The CMS_STREAM flag was first supported in OpenSSL 1.0.0. 1.0.0e 2009-09-30 CMS_compress(3SSL)
Man Page