1=pod 2 3=head1 NAME 4 5SMIME_write_PKCS7 - convert PKCS#7 structure to S/MIME format. 6 7=head1 SYNOPSIS 8 9int SMIME_write_PKCS7(BIO *out, PKCS7 *p7, BIO *data, int flags); 10 11=head1 DESCRIPTION 12 13SMIME_write_PKCS7() adds the appropriate MIME headers to a PKCS#7 14structure to produce an S/MIME message. 15 16B<out> is the BIO to write the data to. B<p7> is the appropriate 17B<PKCS7> structure. If cleartext signing (B<multipart/signed>) is 18being used then the signed data must be supplied in the B<data> 19argument. B<flags> is an optional set of flags. 20 21=head1 NOTES 22 23The following flags can be passed in the B<flags> parameter. 24 25If B<PKCS7_DETACHED> is set then cleartext signing will be used, 26this option only makes sense for signedData where B<PKCS7_DETACHED> 27is also set when PKCS7_sign() is also called. 28 29If the B<PKCS7_TEXT> flag is set MIME headers for type B<text/plain> 30are added to the content, this only makes sense if B<PKCS7_DETACHED> 31is also set. 32 33If the B<PKCS7_PARTSIGN> flag is set the signed data is finalized 34and output along with the content. This flag should only be set 35if B<PKCS7_DETACHED> is also set and the previous call to PKCS7_sign() 36also set these flags. 37 38If cleartext signing is being used and B<PKCS7_PARTSIGN> not set then 39the data must be read twice: once to compute the signature in PKCS7_sign() 40and once to output the S/MIME message. 41 42=head1 BUGS 43 44SMIME_write_PKCS7() always base64 encodes PKCS#7 structures, there 45should be an option to disable this. 46 47=head1 RETURN VALUES 48 49SMIME_write_PKCS7() returns 1 for success or 0 for failure. 50 51=head1 SEE ALSO 52 53L<ERR_get_error(3)|ERR_get_error(3)>, L<PKCS7_sign(3)|PKCS7_sign(3)>, 54L<PKCS7_verify(3)|PKCS7_verify(3)>, L<PKCS7_encrypt(3)|PKCS7_encrypt(3)> 55L<PKCS7_decrypt(3)|PKCS7_decrypt(3)> 56 57=head1 HISTORY 58 59SMIME_write_PKCS7() was added to OpenSSL 0.9.5 60 61=cut 62