BIO_new_CMS(3) OpenSSL BIO_new_CMS(3) NNAAMMEE BIO_new_CMS - CMS streaming filter BIO SSYYNNOOPPSSIISS #include BIO *BIO_new_CMS(BIO *out, CMS_ContentInfo *cms); DDEESSCCRRIIPPTTIIOONN _B_I_O___n_e_w___C_M_S_(_) returns a streaming filter BIO chain based on ccmmss. The output of the filter is written to oouutt. Any data written to the chain is automatically translated to a BER format CMS structure of the appro- priate type. NNOOTTEESS 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 _B_I_O___f_l_u_s_h_(_) must be called to finalise the structure. The CCMMSS__SSTTRREEAAMM flag must be included in the corresponding ffllaaggss parame- ter of the ccmmss creation function. If an application wishes to write additional data to oouutt BIOs should be removed from the chain using _B_I_O___p_o_p_(_) and freed with _B_I_O___f_r_e_e_(_) until oouutt is reached. If no additional data needs to be written _B_I_O___f_r_e_e___a_l_l_(_) 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 struc- tures. Prepending a _B_I_O___f___b_u_f_f_e_r_(_) buffering BIO will prevent this. BBUUGGSS There is currently no corresponding inverse BIO: i.e. one which can decode a CMS structure on the fly. RREETTUURRNN VVAALLUUEESS _B_I_O___n_e_w___C_M_S_(_) returns a BIO chain when successful or NULL if an error occurred. The error can be obtained from _E_R_R___g_e_t___e_r_r_o_r(3). SSEEEE AALLSSOO _E_R_R___g_e_t___e_r_r_o_r(3), _C_M_S___s_i_g_n(3), _C_M_S___e_n_c_r_y_p_t(3) HHIISSTTOORRYY _B_I_O___n_e_w___C_M_S_(_) was added to OpenSSL 1.0.0 1.0.2u 2019-12-20 BIO_new_CMS(3)