PKCS7_encrypt(3) | LibreSSL | PKCS7_encrypt(3) |
NAME
PKCS7_encrypt - create a PKCS#7 envelopedData structureSYNOPSIS
#include <openssl/pkcs7.h>
PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, const EVP_CIPHER *cipher, int flags);
DESCRIPTION
PKCS7_encrypt() creates and returns a PKCS#7 envelopedData structure. certs is a list of recipient certificates. in is the content to be encrypted. cipher is the symmetric cipher to use. flags is an optional set of flags.NOTES
Only RSA keys are supported in PKCS#7 and envelopedData so the recipient certificates supplied to this function must all contain RSA public keys, though they do not have to be signed using the RSA algorithm.NOTES
If the flag PKCS7_STREAM is set the returned PKCS7 structure is not complete and outputting its contents via a function that does not properly finalize the PKCS7 structure will give unpredictable results.RETURN VALUES
PKCS7_encrypt() returns either a PKCS7 structure or NULL if an error occurred. The error can be obtained from ERR_get_error(3).SEE ALSO
ERR_get_error(3), PKCS7_decrypt(3)HISTORY
PKCS7_decrypt() was added to OpenSSL 0.9.5 The PKCS7_STREAM flag was first supported in OpenSSL 1.0.0.2015-10-26 | LibreSSL |