CMS_add0_cert(3) OpenSSL CMS_add0_cert(3) NNAAMMEE CMS_add0_cert, CMS_add1_cert, CMS_get1_certs, CMS_add0_crl, CMS_add1_crl, CMS_get1_crls, - CMS certificate and CRL utility func- tions SSYYNNOOPPSSIISS #include int CMS_add0_cert(CMS_ContentInfo *cms, X509 *cert); int CMS_add1_cert(CMS_ContentInfo *cms, X509 *cert); STACK_OF(X509) *CMS_get1_certs(CMS_ContentInfo *cms); int CMS_add0_crl(CMS_ContentInfo *cms, X509_CRL *crl); int CMS_add1_crl(CMS_ContentInfo *cms, X509_CRL *crl); STACK_OF(X509_CRL) *CMS_get1_crls(CMS_ContentInfo *cms); DDEESSCCRRIIPPTTIIOONN _C_M_S___a_d_d_0___c_e_r_t_(_) and _C_M_S___a_d_d_1___c_e_r_t_(_) add certificate cceerrtt to ccmmss. must be of type signed data or enveloped data. _C_M_S___g_e_t_1___c_e_r_t_s_(_) returns all certificates in ccmmss. _C_M_S___a_d_d_0___c_r_l_(_) and _C_M_S___a_d_d_1___c_r_l_(_) add CRL ccrrll to ccmmss. _C_M_S___g_e_t_1___c_r_l_s_(_) returns any CRLs in ccmmss. NNOOTTEESS The CMS_ContentInfo structure ccmmss must be of type signed data or enveloped data or an error will be returned. For signed data certificates and CRLs are added to the cceerrttiiffiiccaatteess and ccrrllss fields of SignedData structure. For enveloped data they are added to OOrriiggiinnaattoorrIInnffoo. As the 00 implies _C_M_S___a_d_d_0___c_e_r_t_(_) adds cceerrtt internally to ccmmss and it must not be freed up after the call as opposed to _C_M_S___a_d_d_1___c_e_r_t_(_) where cceerrtt must be freed up. The same certificate or CRL must not be added to the same cms structure more than once. RREETTUURRNN VVAALLUUEESS _C_M_S___a_d_d_0___c_e_r_t_(_), _C_M_S___a_d_d_1___c_e_r_t_(_) and _C_M_S___a_d_d_0___c_r_l_(_) and _C_M_S___a_d_d_1___c_r_l_(_) return 1 for success and 0 for failure. _C_M_S___g_e_t_1___c_e_r_t_s_(_) and _C_M_S___g_e_t_1___c_r_l_s_(_) return the STACK of certificates or CRLs or NULL if there are none or an error occurs. The only error which will occur in practice is if the ccmmss type is invalid. 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 _C_M_S___a_d_d_0___c_e_r_t_(_), _C_M_S___a_d_d_1___c_e_r_t_(_), _C_M_S___g_e_t_1___c_e_r_t_s_(_), _C_M_S___a_d_d_0___c_r_l_(_) and _C_M_S___g_e_t_1___c_r_l_s_(_) were all first added to OpenSSL 0.9.8 1.0.2u 2019-12-20 CMS_add0_cert(3)