1 1.1 christos =pod 2 1.1 christos 3 1.1 christos =head1 NAME 4 1.1 christos 5 1.1 christos PKCS7_decrypt - decrypt content from a PKCS#7 envelopedData structure 6 1.1 christos 7 1.1 christos =head1 SYNOPSIS 8 1.1 christos 9 1.1 christos #include <openssl/pkcs7.h> 10 1.1 christos 11 1.1 christos int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, int flags); 12 1.1 christos 13 1.1 christos =head1 DESCRIPTION 14 1.1 christos 15 1.1 christos PKCS7_decrypt() extracts and decrypts the content from a PKCS#7 envelopedData 16 1.1 christos structure. B<pkey> is the private key of the recipient, B<cert> is the 17 1.1 christos recipients certificate, B<data> is a BIO to write the content to and 18 1.1 christos B<flags> is an optional set of flags. 19 1.1 christos 20 1.1 christos =head1 NOTES 21 1.1 christos 22 1.1 christos Although the recipients certificate is not needed to decrypt the data it is needed 23 1.1 christos to locate the appropriate (of possible several) recipients in the PKCS#7 structure. 24 1.1 christos 25 1.1 christos The following flags can be passed in the B<flags> parameter. 26 1.1 christos 27 1.1 christos If the B<PKCS7_TEXT> flag is set MIME headers for type B<text/plain> are deleted 28 1.1 christos from the content. If the content is not of type B<text/plain> then an error is 29 1.1 christos returned. 30 1.1 christos 31 1.1 christos =head1 RETURN VALUES 32 1.1 christos 33 1.1 christos PKCS7_decrypt() returns either 1 for success or 0 for failure. 34 1.1 christos The error can be obtained from ERR_get_error(3) 35 1.1 christos 36 1.1 christos =head1 BUGS 37 1.1 christos 38 1.1 christos PKCS7_decrypt() must be passed the correct recipient key and certificate. It would 39 1.1 christos be better if it could look up the correct key and certificate from a database. 40 1.1 christos 41 1.1 christos The lack of single pass processing and need to hold all data in memory as 42 1.1 christos mentioned in PKCS7_sign() also applies to PKCS7_verify(). 43 1.1 christos 44 1.1 christos =head1 SEE ALSO 45 1.1 christos 46 1.1 christos L<ERR_get_error(3)>, L<PKCS7_encrypt(3)> 47 1.1 christos 48 1.1 christos =head1 COPYRIGHT 49 1.1 christos 50 1.1 christos Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved. 51 1.1 christos 52 1.1.1.2 christos Licensed under the Apache License 2.0 (the "License"). You may not use 53 1.1 christos this file except in compliance with the License. You can obtain a copy 54 1.1 christos in the file LICENSE in the source distribution or at 55 1.1 christos L<https://www.openssl.org/source/license.html>. 56 1.1 christos 57 1.1 christos =cut 58