Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

bio_new_cms(3ssl) [linux man page]

BIO_new_CMS(3SSL)						      OpenSSL							 BIO_new_CMS(3SSL)

NAME
BIO_new_CMS - CMS streaming filter BIO SYNOPSIS
#include <openssl/cms.h> BIO *BIO_new_CMS(BIO *out, CMS_ContentInfo *cms); DESCRIPTION
BIO_new_CMS() returns a streaming filter BIO chain based on cms. The output of the filter is written to out. Any data written to the chain is automatically translated to a BER format CMS structure of the appropriate type. NOTES
The chain returned by this function behaves like a standard filter BIO. It supports non blocking I/O. Content is processed and streamed on the fly and not all held in memory at once: so it is possible to encode very large structures. After all content has been written through the chain BIO_flush() must be called to finalise the structure. The CMS_STREAM flag must be included in the corresponding flags parameter of the cms creation function. If an application wishes to write additional data to out BIOs should be removed from the chain using BIO_pop() and freed with BIO_free() until out is reached. If no additional data needs to be written BIO_free_all() can be called to free up the whole chain. Any content written through the filter is used verbatim: no canonical translation is performed. It is possible to chain multiple BIOs to, for example, create a triple wrapped signed, enveloped, signed structure. In this case it is the applications responsibility to set the inner content type of any outer CMS_ContentInfo structures. Large numbers of small writes through the chain should be avoided as this will produce an output consisting of lots of OCTET STRING structures. Prepending a BIO_f_buffer() buffering BIO will prevent this. BUGS
There is currently no corresponding inverse BIO: i.e. one which can decode a CMS structure on the fly. RETURN VALUES
BIO_new_CMS() returns a BIO chain when successful or NULL if an error occurred. The error can be obtained from ERR_get_error(3). SEE ALSO
ERR_get_error(3), CMS_sign(3), CMS_encrypt(3) HISTORY
BIO_new_CMS() was added to OpenSSL 1.0.0 1.0.0e 2009-09-30 BIO_new_CMS(3SSL)

Check Out this Related Man Page

CMS_compress(3) 						      OpenSSL							   CMS_compress(3)

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.1e 2013-02-11 CMS_compress(3)
Man Page