1PKCS7_decrypt(3)                    OpenSSL                   PKCS7_decrypt(3)
2
3
4

NAME

6       PKCS7_decrypt - decrypt content from a PKCS#7 envelopedData structure
7

SYNOPSIS

9       int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, int
10       flags);
11

DESCRIPTION

13       PKCS7_decrypt() extracts and decrypts the content from a PKCS#7
14       envelopedData structure. pkey is the private key of the recipient, cert
15       is the recipients certificate, data is a BIO to write the content to
16       and flags is an optional set of flags.
17

NOTES

19       OpenSSL_add_all_algorithms() (or equivalent) should be called before
20       using this function or errors about unknown algorithms will occur.
21
22       Although the recipients certificate is not needed to decrypt the data
23       it is needed to locate the appropriate (of possible several) recipients
24       in the PKCS#7 structure.
25
26       The following flags can be passed in the flags parameter.
27
28       If the PKCS7_TEXT flag is set MIME headers for type text/plain are
29       deleted from the content. If the content is not of type text/plain then
30       an error is returned.
31

RETURN VALUES

33       PKCS7_decrypt() returns either 1 for success or 0 for failure.  The
34       error can be obtained from ERR_get_error(3)
35

BUGS

37       PKCS7_decrypt() must be passed the correct recipient key and certifi‐
38       cate. It would be better if it could look up the correct key and cer‐
39       tificate from a database.
40
41       The lack of single pass processing and need to hold all data in memory
42       as mentioned in PKCS7_sign() also applies to PKCS7_verify().
43

SEE ALSO

45       ERR_get_error(3), PKCS7_encrypt(3)
46

HISTORY

48       PKCS7_decrypt() was added to OpenSSL 0.9.5
49
50
51
520.9.8b                            2002-10-09                  PKCS7_decrypt(3)
Impressum