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