1SMIME_READ_CMS(3) OpenSSL SMIME_READ_CMS(3)
2
3
4
6 SMIME_read_CMS - parse S/MIME message
7
9 #include <openssl/cms.h>
10
11 CMS_ContentInfo *SMIME_read_CMS(BIO *in, BIO **bcont);
12
14 SMIME_read_CMS() parses a message in S/MIME format.
15
16 in is a BIO to read the message from.
17
18 If cleartext signing is used then the content is saved in a memory bio
19 which is written to *bcont, otherwise *bcont is set to NULL.
20
21 The parsed CMS_ContentInfo structure is returned or NULL if an error
22 occurred.
23
25 If *bcont is not NULL then the message is clear text signed. *bcont can
26 then be passed to CMS_verify() with the CMS_DETACHED flag set.
27
28 Otherwise the type of the returned structure can be determined using
29 CMS_get0_type().
30
31 To support future functionality if bcont is not NULL *bcont should be
32 initialized to NULL. For example:
33
34 BIO *cont = NULL;
35 CMS_ContentInfo *cms;
36
37 cms = SMIME_read_CMS(in, &cont);
38
40 The MIME parser used by SMIME_read_CMS() is somewhat primitive. While
41 it will handle most S/MIME messages more complex compound formats may
42 not work.
43
44 The parser assumes that the CMS_ContentInfo structure is always base64
45 encoded and will not handle the case where it is in binary format or
46 uses quoted printable format.
47
48 The use of a memory BIO to hold the signed content limits the size of
49 message which can be processed due to memory restraints: a streaming
50 single pass option should be available.
51
53 SMIME_read_CMS() returns a valid CMS_ContentInfo structure or NULL if
54 an error occurred. The error can be obtained from ERR_get_error(3).
55
57 ERR_get_error(3), CMS_type(3), SMIME_read_CMS(3), CMS_sign(3),
58 CMS_verify(3), CMS_encrypt(3), CMS_decrypt(3)
59
61 Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved.
62
63 Licensed under the OpenSSL license (the "License"). You may not use
64 this file except in compliance with the License. You can obtain a copy
65 in the file LICENSE in the source distribution or at
66 <https://www.openssl.org/source/license.html>.
67
68
69
701.1.1k 2021-03-26 SMIME_READ_CMS(3)