Blame doc/man3/SMIME_read_CMS.pod

Packit c4476c
=pod
Packit c4476c
Packit c4476c
=head1 NAME
Packit c4476c
Packit c4476c
SMIME_read_CMS - parse S/MIME message
Packit c4476c
Packit c4476c
=head1 SYNOPSIS
Packit c4476c
Packit c4476c
 #include <openssl/cms.h>
Packit c4476c
Packit c4476c
 CMS_ContentInfo *SMIME_read_CMS(BIO *in, BIO **bcont);
Packit c4476c
Packit c4476c
=head1 DESCRIPTION
Packit c4476c
Packit c4476c
SMIME_read_CMS() parses a message in S/MIME format.
Packit c4476c
Packit c4476c
B<in> is a BIO to read the message from.
Packit c4476c
Packit c4476c
If cleartext signing is used then the content is saved in a memory bio which is
Packit c4476c
written to B<*bcont>, otherwise B<*bcont> is set to NULL.
Packit c4476c
Packit c4476c
The parsed CMS_ContentInfo structure is returned or NULL if an
Packit c4476c
error occurred.
Packit c4476c
Packit c4476c
=head1 NOTES
Packit c4476c
Packit c4476c
If B<*bcont> is not NULL then the message is clear text signed. B<*bcont> can
Packit c4476c
then be passed to CMS_verify() with the B<CMS_DETACHED> flag set.
Packit c4476c
Packit c4476c
Otherwise the type of the returned structure can be determined
Packit c4476c
using CMS_get0_type().
Packit c4476c
Packit c4476c
To support future functionality if B<bcont> is not NULL B<*bcont> should be
Packit c4476c
initialized to NULL. For example:
Packit c4476c
Packit c4476c
 BIO *cont = NULL;
Packit c4476c
 CMS_ContentInfo *cms;
Packit c4476c
Packit c4476c
 cms = SMIME_read_CMS(in, &cont;;
Packit c4476c
Packit c4476c
=head1 BUGS
Packit c4476c
Packit c4476c
The MIME parser used by SMIME_read_CMS() is somewhat primitive.  While it will
Packit c4476c
handle most S/MIME messages more complex compound formats may not work.
Packit c4476c
Packit c4476c
The parser assumes that the CMS_ContentInfo structure is always base64 encoded
Packit c4476c
and will not handle the case where it is in binary format or uses quoted
Packit c4476c
printable format.
Packit c4476c
Packit c4476c
The use of a memory BIO to hold the signed content limits the size of message
Packit c4476c
which can be processed due to memory restraints: a streaming single pass option
Packit c4476c
should be available.
Packit c4476c
Packit c4476c
=head1 RETURN VALUES
Packit c4476c
Packit c4476c
SMIME_read_CMS() returns a valid B<CMS_ContentInfo> structure or B<NULL>
Packit c4476c
if an error occurred. The error can be obtained from ERR_get_error(3).
Packit c4476c
Packit c4476c
=head1 SEE ALSO
Packit c4476c
Packit c4476c
L<ERR_get_error(3)>, L<CMS_type(3)>,
Packit c4476c
L<SMIME_read_CMS(3)>, L<CMS_sign(3)>,
Packit c4476c
L<CMS_verify(3)>, L<CMS_encrypt(3)>,
Packit c4476c
L<CMS_decrypt(3)>
Packit c4476c
Packit c4476c
=head1 COPYRIGHT
Packit c4476c
Packit c4476c
Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved.
Packit c4476c
Packit c4476c
Licensed under the OpenSSL license (the "License").  You may not use
Packit c4476c
this file except in compliance with the License.  You can obtain a copy
Packit c4476c
in the file LICENSE in the source distribution or at
Packit c4476c
L<https://www.openssl.org/source/license.html>.
Packit c4476c
Packit c4476c
=cut