1=pod
2
3=head1 NAME
4
5CMS_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
18CMS_EncryptedData_decrypt() decrypts a I<cms> EncryptedData object using the
19symmetric I<key> of size I<keylen> bytes. I<out> is a BIO to write the content
20to and I<flags> is an optional set of flags.
21I<dcont> is used in the rare case where the encrypted content is detached. It
22will normally be set to NULL.
23
24The following flags can be passed in the I<flags> parameter.
25
26If the B<CMS_TEXT> flag is set MIME headers for type C<text/plain> are deleted
27from the content. If the content is not of type C<text/plain> then an error is
28returned.
29
30=head1 RETURN VALUES
31
32CMS_EncryptedData_decrypt() returns 0 if an error occurred otherwise it
33returns 1.
34
35=head1 SEE ALSO
36
37L<ERR_get_error(3)>, L<CMS_EncryptedData_encrypt(3)>
38
39
40=head1 COPYRIGHT
41
42Copyright 2020-2023 The OpenSSL Project Authors. All Rights Reserved.
43
44Licensed under the Apache License 2.0 (the "License").  You may not use
45this file except in compliance with the License.  You can obtain a copy
46in the file LICENSE in the source distribution or at
47L<https://www.openssl.org/source/license.html>.
48
49=cut
50