17850a98af3f523eed7223042a41ba9f7dc1c35b
[openssl.git] / doc / man3 / CMS_EncryptedData_decrypt.pod
1 =pod
2
3 =head1 NAME
4
5 CMS_EncryptedData_decrypt
6 - Decrypt CMS EncryptedData
7
8 =head1 SYNOPSIS
9
10  #include <openssl/cms.h>
11
12  int CMS_EncryptedData_decrypt(CMS_ContentInfo *cms,
13                                const unsigned char *key, size_t keylen,
14                                BIO *dcont, BIO *out, unsigned int flags);
15
16 =head1 DESCRIPTION
17
18 CMS_EncryptedData_decrypt() decrypts a I<cms> EncryptedData object using the
19 symmetric I<key> of size I<keylen> bytes. I<out> is a BIO to write the content
20 to and I<flags> is an optional set of flags.
21 I<dcont> is used in the rare case where the encrypted content is detached. It
22 will normally be set to NULL.
23
24 The following flags can be passed in the B<flags> parameter.
25
26 If the B<CMS_TEXT> flag is set MIME headers for type B<text/plain> are deleted
27 from the content. If the content is not of type B<text/plain> then an error is
28 returned.
29
30 =head1 RETURN VALUES
31
32 CMS_EncryptedData_decrypt() returns 0 if an error occurred otherwise it
33 returns 1.
34
35 =head1 SEE ALSO
36
37 L<ERR_get_error(3)>, L<CMS_EncryptedData_encrypt(3)>
38
39
40 =head1 COPYRIGHT
41
42 Copyright 2020 The OpenSSL Project Authors. All Rights Reserved.
43
44 Licensed under the Apache License 2.0 (the "License").  You may not use
45 this file except in compliance with the License.  You can obtain a copy
46 in the file LICENSE in the source distribution or at
47 L<https://www.openssl.org/source/license.html>.
48
49 =cut