1BIO_NEW_CMS(3)                      OpenSSL                     BIO_NEW_CMS(3)
2
3
4

NAME

6       BIO_new_CMS - CMS streaming filter BIO
7

SYNOPSIS

9        #include <openssl/cms.h>
10
11        BIO *BIO_new_CMS(BIO *out, CMS_ContentInfo *cms);
12

DESCRIPTION

14       BIO_new_CMS() returns a streaming filter BIO chain based on cms. The
15       output of the filter is written to out. Any data written to the chain
16       is automatically translated to a BER format CMS structure of the
17       appropriate type.
18

NOTES

20       The chain returned by this function behaves like a standard filter BIO.
21       It supports non blocking I/O. Content is processed and streamed on the
22       fly and not all held in memory at once: so it is possible to encode
23       very large structures.  After all content has been written through the
24       chain BIO_flush() must be called to finalise the structure.
25
26       The CMS_STREAM flag must be included in the corresponding flags
27       parameter of the cms creation function.
28
29       If an application wishes to write additional data to out BIOs should be
30       removed from the chain using BIO_pop() and freed with BIO_free() until
31       out is reached. If no additional data needs to be written
32       BIO_free_all() can be called to free up the whole chain.
33
34       Any content written through the filter is used verbatim: no canonical
35       translation is performed.
36
37       It is possible to chain multiple BIOs to, for example, create a triple
38       wrapped signed, enveloped, signed structure. In this case it is the
39       applications responsibility to set the inner content type of any outer
40       CMS_ContentInfo structures.
41
42       Large numbers of small writes through the chain should be avoided as
43       this will produce an output consisting of lots of OCTET STRING
44       structures. Prepending a BIO_f_buffer() buffering BIO will prevent
45       this.
46

BUGS

48       There is currently no corresponding inverse BIO: i.e. one which can
49       decode a CMS structure on the fly.
50

RETURN VALUES

52       BIO_new_CMS() returns a BIO chain when successful or NULL if an error
53       occurred. The error can be obtained from ERR_get_error(3).
54

SEE ALSO

56       ERR_get_error(3), CMS_sign(3), CMS_encrypt(3)
57

HISTORY

59       The BIO_new_CMS() function was added in OpenSSL 1.0.0.
60
62       Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved.
63
64       Licensed under the OpenSSL license (the "License").  You may not use
65       this file except in compliance with the License.  You can obtain a copy
66       in the file LICENSE in the source distribution or at
67       <https://www.openssl.org/source/license.html>.
68
69
70
711.1.1q                            2023-02-06                    BIO_NEW_CMS(3)
Impressum