CMS_ENCRYPTEDDATA_DECRYPT(3SSL)
π CMS_EncryptedData_decrypt β bestie edition π
okay so this is the OpenSSL manual page for CMS_ENCRYPTEDDATA_DECRYPT(3SSL) β yes the whole 3SSL section vibe β and babes, it's literally all about decrypting CMS EncryptedData or EnvelopedData objects. Two functions, one glow-up. Let's go π«Ά
β¨ NAME β¨
CMS_EncryptedData_decrypt, CMS_EnvelopedData_decrypt β decrypt CMS EncryptedData or EnvelopedData. it's giving "unlock the content, queen". π
π SYNOPSIS π
#include <openssl/cms.h>
int CMS_EncryptedData_decrypt(CMS_ContentInfo *cms,
const unsigned char *key, size_t keylen,
BIO *dcont, BIO *out, unsigned int flags);
BIO *CMS_EnvelopedData_decrypt(CMS_EnvelopedData *env, BIO *detached_data,
EVP_PKEY *pkey, X509 *cert,
ASN1_OCTET_STRING *secret, unsigned int flags,
OSSL_LIB_CTX *libctx, const char *propq);
look at those signatures. so clean. so precise. πΈ
π DESCRIPTION π
CMS_EncryptedData_decrypt() decrypts a cms EncryptedData object using the symmetric key of size keylen bytes. β¨ Heads up though β AEAD cipher algorithms are not supported, so don't even try it bestie, it's not happening π. out is a BIO to write the content to, and flags is an optional set of flags. dcont is used in the rare case where the encrypted content is detached β it will normally be set to NULL.
The following flags can be passed in the flags parameter. π
CMS_TEXTβ if this flag is set, MIME headers for type"text/plain"are deleted from the content. but if the content is not of type"text/plain", then an error is returned. so it's a whole vibe check: wrong type, no entry. π
CMS_EnvelopedData_decrypt() decrypts, similarly to CMS_decrypt(3), a CMS EnvelopedData object env using the symmetric key secret if it is not NULL, otherwise the private key of the recipient pkey. If pkey is given, it is recommended to provide also the associated certificate in cert β see CMS_decrypt(3) and the NOTES on cert there. π The optional parameters flags and dcont are used as described above. The optional parameters library context libctx and property query propq are used when retrieving algorithms from providers. providers said "i gotchu" π
π RETURN VALUES π
CMS_EncryptedData_decrypt()returns0if an error occurred, otherwise returns1. simple. binary. iconic. β¨CMS_EnvelopedData_decrypt()returnsNULLif an error occurred, otherwise aBIOcontaining the decrypted content. π₯
π¦ SEE ALSO π¦
go read those too, iykyk π
β HISTORY β
CMS_EnvelopedData_decrypt() was added in OpenSSL 3.2. babygirl is still new-ish, be nice to her π
π COPYRIGHT π
Copyright 2020-2026 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.
and that's the whole page, bestie β no notes, periodt. π This was 4.0.3, dated 2026-09-29, from the CMS_ENCRYPTEDDATA_DECRYPT(3SSL) era of the OpenSSL universe. stan a well-documented crypto library fr fr πΈπ
β¨
π¦ where this page comes from
- ubuntu stonking: libssl-doc 4.0.3-1ubuntu1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms