CMS_ENCRYPTEDDATA_SET1_KEY(3ossl)
π CMS_ENCRYPTEDDATA_SET1_KEY π
okay bestie, so this is a page from the OpenSSL manual, section 3ossl β and we're talking about CMS_EncryptedData_set1_key. yes it's a mouthful, yes it's iconic, let's go π«Ά
β¨ NAME β¨
CMS_EncryptedData_set1_key β Sets the cipher and key for CMS EncryptedData π
πΈ SYNOPSIS πΈ
#include <openssl/cms.h>
int CMS_EncryptedData_set1_key(CMS_ContentInfo *cms, const EVP_CIPHER *ciph,
const unsigned char *key, size_t keylen);
look at that signature, so clean, so demure π
π¦ DESCRIPTION π¦
So CMS_EncryptedData_set1_key() takes in a cms EncryptedData object and sets the appropriate attributes to ciph. β¨ And the way it makes a copy of the symmetric key of size keylen?? Obsessed. It's giving "your key is safe with me, I'm making my own copy bestie."
π BUT β listen, this is important β AEAD cipher algorithms are not supported. Not a vibe. Don't try it. No cap.
π RETURN VALUES π
CMS_EncryptedData_set1_key()returns0if an error occurred π- otherwise it returns
1β slay β¨
literally that's it, binary queen, no in-between π
π SEE ALSO π
go read those too, they're the besties of this function fr fr π«Ά
π COPYRIGHT π
Copyright 2025 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>.
okay and that's the whole page, bestie!! πΈ this version dropped in 3.5.9 on 2026-09-29, straight from the OpenSSL girlies. go set some keys, stay hydrated, and remember: no AEAD allowed. mwah πβ¨π§
π¦ where this page comes from
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms