CMS_ENCRYPTEDDATA_SET1_KEY(3SSL)

πŸ’– NAME πŸ’–

CMS_EncryptedData_set1_key β€” bestie, this is the one that sets the cipher and the key for a 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);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so CMS_EncryptedData_set1_key()</p> rolls up to a cms EncryptedData object and sets the appropriate attributes over to ciph β€” like, it literally hands the whole vibe over to that cipher. and then πŸ’… it makes a copy of the symmetric key of size keylen, so your key is safe, she's got her own little duplicate, no sharing, no cap.

🚨 IMPORTANT GIRLIE WARNING 🚨 β€” AEAD cipher algorithms are not supported. like, at all. do not come for her with an AEAD, she will not answer the phone. πŸ’€

🌸 RETURN VALUES 🌸

  • 0 β€” something went wrong, an error occurred, we're crying 😭
  • 1 β€” slay!! everything worked, no error, we ate πŸ‘‘

so basically it returns 0 if an error occurred, otherwise it returns 1. that's the whole thing. periodt. ✨


🫢 SEE ALSO 🫢

go read those next bestie, they're the whole friend group 🌈


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>.


k that's the whole page, you understood all of it, iconic behavior fr fr πŸ§šπŸ’œ

this was CMS_ENCRYPTEDDATA_SET1_KEY(3SSL) from the OpenSSL manual, version 4.0.3, dated 2026-09-29 β€” mwah, catch you on the next one bestie πŸ’–βœ¨

πŸ“¦ where this page comes from