CMS_DATA_CREATE(3ossl)

πŸ“¦ version 3.5.0, in opensuse-leap 16.0

πŸ’… CMS_DATA_CREATE(3ossl) β€” like, the whole glow-up

okay so bestie, this is the CMS_DATA_CREATE(3ossl) page, and honestly? it's giving "small but mighty." it's a manual page from the OpenSSL fam, and by the end of this you're gonna know exactly how to spin up a CMS Data object. no cap. πŸŽ€


✨ NAME ✨

CMS_data_create_ex, CMS_data_create β€” create a CMS Data object. that's it, that's the whole vibe. two functions, one job: make the thing. 🫢


🌸 SYNOPSIS 🌸

#include <openssl/cms.h>

CMS_ContentInfo *CMS_data_create_ex(BIO *in, unsigned int flags,
                                    OSSL_LIB_CTX *libctx, const char *propq);
CMS_ContentInfo *CMS_data_create(BIO *in, unsigned int flags);

like, look at them. four args and two args respectively. the _ex one is the main character, the short one is her chill little sister. πŸ’–


πŸ¦‹ DESCRIPTION πŸ¦‹

so CMS_data_create_ex() creates a CMS_ContentInfo structure with a type of NID_pkcs7_data. slay. the actual data comes from the in BIO β€” that's where you feed it. πŸ“

the library context libctx and the property query propq are what get used when retrieving algorithms from providers. iykyk. and the flags field supports the CMS_STREAM flag. that's the one flag on the menu, bestie, don't go looking for more.

heads up: internally CMS_final() is called unless CMS_STREAM is specified. like, it's automatic but not that automatic. 😭

when you're done with your CMS_ContentInfo structure, you can free it with CMS_ContentInfo_free(3). please actually do that. your valgrind will thank you. 🧚

and CMS_data_create() is similar to CMS_data_create_ex() but uses default values of NULL for the library context libctx and the property query propq. so like, the simple version. lowkey convenient, highkey the same thing. ✨


πŸ”₯ RETURN VALUES πŸ”₯

if the allocation fails, both CMS_data_create_ex() and CMS_data_create() return NULL and set an error code that you can grab with ERR_get_error(3). so don't just stare at the NULL, go get the error. πŸ’€

otherwise? they return a pointer to the newly allocated structure. iconic. πŸ‘‘


🌈 SEE ALSO 🌈

that's the whole friend group. go say hi. 🫢


⭐ HISTORY ⭐

the CMS_data_create_ex() method was added in OpenSSL 3.0. so she's relatively new to the scene but she's already thriving. πŸ’œ


copyright 2020-2021 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>. legal bestie has entered the chat, please respect her. πŸ™ˆ


okay that's the whole page!! this one's from 3.5.0, dated 2026-09-25, and it's the CMS_DATA_CREATE(3ossl) page. go forth and create your data objects, bestie β€” you're literally gonna slay. πŸ’…πŸŒΈβœ¨

πŸ“¦ where this page comes from