CMS_ENCRYPTEDDATA_SET1_KEY(3ossl)

πŸ“¦
version 15.1 Β· 2 versions
, in freebsd 15.1

πŸ’… CMS_EncryptedData_set1_key β€” the 3ossl manual page ✨

✨ NAME ✨

CMS_EncryptedData_set1_key β€” sets the cipher and key for CMS EncryptedData. that’s literally the whole assignment, bestie πŸ’–

πŸŽ€ 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() takes in a cms EncryptedData object and sets the appropriate attributes to ciph. it also makes a copy of the symmetric key of size keylen. 🫢

🚨 real talk: AEAD cipher algorithms are not supported. do not try it, bestie β€” that is not the vibe. πŸ’€

🌸 RETURN VALUES 🌸

CMS_EncryptedData_set1_key() returns 0 if an error occurred; otherwise it returns 1. so: 0 = nope, error 😭 and 1 = slay, good to go βœ…

πŸ¦‹ SEE ALSO πŸ¦‹

go read these next, bestie:

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


πŸ’– that’s the page, bestie. this one is from OpenSSL 3.5.6, dated 2026-04-07 β€” mwah, bye! 🫢

πŸ“¦ where this page comes from