libressl-SMIME_read_CMS3
Extract cms contentinfo from an s/mime message
Usage
Crypto Library (libcrypto, -lcrypto)
#include <openssl/cms.h>
CMS_ContentInfo *
SMIME_read_CMS(BIO *in, BIO **bcont);
Overview
SMIME_read_CMS() parses a message in S/MIME format from in.
If the message uses cleartext signing, the content is saved in a memory BIO which is written to *bcont and which can then be passed to CMS_verify(3) with the CMS_DETACHED flag set. Otherwise, *bcont is set to NULL and the type of the returned structure can be determined using CMS_get0_type(3).
To support future functionality if bcont is not NULL, *bcont should be initialized to NULL, for example:
BIO *cont = NULL; CMS_ContentInfo *cms = SMIME_read_CMS(in, &cont);
Return values
SMIME_read_CMS() returns a valid CMS_ContentInfo structure or NULL if an error occurred. The error can be obtained from ERR_get_error(3).