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