CMS_get0_type(3) OpenSSL CMS_get0_type(3) NNAAMMEE CMS_get0_type, CMS_set1_eContentType, CMS_get0_eContentType, CMS_get0_content - get and set CMS content types and content SSYYNNOOPPSSIISS #include const ASN1_OBJECT *CMS_get0_type(CMS_ContentInfo *cms); int CMS_set1_eContentType(CMS_ContentInfo *cms, const ASN1_OBJECT *oid); const ASN1_OBJECT *CMS_get0_eContentType(CMS_ContentInfo *cms); ASN1_OCTET_STRING **CMS_get0_content(CMS_ContentInfo *cms); DDEESSCCRRIIPPTTIIOONN _C_M_S___g_e_t_0___t_y_p_e_(_) returns the content type of a CMS_ContentInfo structure as and ASN1_OBJECT pointer. An application can then decide how to process the CMS_ContentInfo structure based on this value. _C_M_S___s_e_t_1___e_C_o_n_t_e_n_t_T_y_p_e_(_) sets the embedded content type of a CMS_Con- tentInfo structure. It should be called with CMS functions with the CCMMSS__PPAARRTTIIAALL flag and bbeeffoorree the structure is finalised, otherwise the results are undefined. ASN1_OBJECT *_C_M_S___g_e_t_0___e_C_o_n_t_e_n_t_T_y_p_e_(_) returns a pointer to the embedded content type. _C_M_S___g_e_t_0___c_o_n_t_e_n_t_(_) returns a pointer to the AASSNN11__OOCCTTEETT__SSTTRRIINNGG pointer containing the embedded content. NNOOTTEESS As the 00 implies _C_M_S___g_e_t_0___t_y_p_e_(_), _C_M_S___g_e_t_0___e_C_o_n_t_e_n_t_T_y_p_e_(_) and _C_M_S___g_e_t_0___c_o_n_t_e_n_t_(_) return internal pointers which should nnoott be freed up. _C_M_S___s_e_t_1___e_C_o_n_t_e_n_t_T_y_p_e_(_) copies the supplied OID and it sshhoouulldd be freed up after use. The AASSNN11__OOBBJJEECCTT values returned can be converted to an integer NNIIDD value using _O_B_J___o_b_j_2_n_i_d_(_). For the currently supported content types the following values are returned: NID_pkcs7_data NID_pkcs7_signed NID_pkcs7_digest NID_id_smime_ct_compressedData: NID_pkcs7_encrypted NID_pkcs7_enveloped The return value of _C_M_S___g_e_t_0___c_o_n_t_e_n_t_(_) is a pointer to the AASSNN11__OOCCTTEETT__SSTTRRIINNGG content pointer. That means that for example: ASN1_OCTET_STRING **pconf = CMS_get0_content(cms); **ppccoonnff could be NULL if there is no embedded content. Applications can access, modify or create the embedded content in a CCMMSS__CCoonntteennttIInnffoo structure using this function. Applications usually will not need to modify the embedded content as it is normally set by higher level func- tions. RREETTUURRNN VVAALLUUEESS _C_M_S___g_e_t_0___t_y_p_e_(_) and _C_M_S___g_e_t_0___e_C_o_n_t_e_n_t_T_y_p_e_(_) return and ASN1_OBJECT structure. _C_M_S___s_e_t_1___e_C_o_n_t_e_n_t_T_y_p_e_(_) returns 1 for success or 0 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) HHIISSTTOORRYY _C_M_S___g_e_t_0___t_y_p_e_(_), _C_M_S___s_e_t_1___e_C_o_n_t_e_n_t_T_y_p_e_(_) and _C_M_S___g_e_t_0___e_C_o_n_t_e_n_t_T_y_p_e_(_) were all first added to OpenSSL 0.9.8 1.0.2u 2019-12-20 CMS_get0_type(3)