Blame doc/man3/SMIME_write_PKCS7.pod

Packit c4476c
=pod
Packit c4476c
Packit c4476c
=head1 NAME
Packit c4476c
Packit c4476c
SMIME_write_PKCS7 - convert PKCS#7 structure to S/MIME format
Packit c4476c
Packit c4476c
=head1 SYNOPSIS
Packit c4476c
Packit c4476c
 #include <openssl/pkcs7.h>
Packit c4476c
Packit c4476c
 int SMIME_write_PKCS7(BIO *out, PKCS7 *p7, BIO *data, int flags);
Packit c4476c
Packit c4476c
=head1 DESCRIPTION
Packit c4476c
Packit c4476c
SMIME_write_PKCS7() adds the appropriate MIME headers to a PKCS#7
Packit c4476c
structure to produce an S/MIME message.
Packit c4476c
Packit c4476c
B<out> is the BIO to write the data to. B<p7> is the appropriate B<PKCS7>
Packit c4476c
structure. If streaming is enabled then the content must be supplied in the
Packit c4476c
B<data> argument. B<flags> is an optional set of flags.
Packit c4476c
Packit c4476c
=head1 NOTES
Packit c4476c
Packit c4476c
The following flags can be passed in the B<flags> parameter.
Packit c4476c
Packit c4476c
If B<PKCS7_DETACHED> is set then cleartext signing will be used,
Packit c4476c
this option only makes sense for signedData where B<PKCS7_DETACHED>
Packit c4476c
is also set when PKCS7_sign() is also called.
Packit c4476c
Packit c4476c
If the B<PKCS7_TEXT> flag is set MIME headers for type B<text/plain>
Packit c4476c
are added to the content, this only makes sense if B<PKCS7_DETACHED>
Packit c4476c
is also set.
Packit c4476c
Packit c4476c
If the B<PKCS7_STREAM> flag is set streaming is performed. This flag should
Packit c4476c
only be set if B<PKCS7_STREAM> was also set in the previous call to
Packit c4476c
PKCS7_sign() or PKCS7_encrypt().
Packit c4476c
Packit c4476c
If cleartext signing is being used and B<PKCS7_STREAM> not set then
Packit c4476c
the data must be read twice: once to compute the signature in PKCS7_sign()
Packit c4476c
and once to output the S/MIME message.
Packit c4476c
Packit c4476c
If streaming is performed the content is output in BER format using indefinite
Packit c4476c
length constructed encoding except in the case of signed data with detached
Packit c4476c
content where the content is absent and DER format is used.
Packit c4476c
Packit c4476c
=head1 BUGS
Packit c4476c
Packit c4476c
SMIME_write_PKCS7() always base64 encodes PKCS#7 structures, there
Packit c4476c
should be an option to disable this.
Packit c4476c
Packit c4476c
=head1 RETURN VALUES
Packit c4476c
Packit c4476c
SMIME_write_PKCS7() returns 1 for success or 0 for failure.
Packit c4476c
Packit c4476c
=head1 SEE ALSO
Packit c4476c
Packit c4476c
L<ERR_get_error(3)>, L<PKCS7_sign(3)>,
Packit c4476c
L<PKCS7_verify(3)>, L<PKCS7_encrypt(3)>
Packit c4476c
L<PKCS7_decrypt(3)>
Packit c4476c
Packit c4476c
=head1 COPYRIGHT
Packit c4476c
Packit c4476c
Copyright 2002-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