CMS_DIGEST_CREATE(3ossl)

✨ CMS_DIGEST_CREATE πŸ’…

okay bestie, welcome to CMS_digest_create(3ossl) β€” yes that's the manual page name, section 3, OpenSSL vibes only. sit down, grab a boba, we're making CMS DigestedData objects πŸŽ€


🌸 NAME 🌸

CMS_digest_create_ex, CMS_digest_create β€” Create a CMS DigestedData object 🧚


πŸ’– SYNOPSIS πŸ’–

#include <openssl/cms.h>

CMS_ContentInfo *CMS_digest_create_ex(BIO *in, const EVP_MD *md,
                                      unsigned int flags, OSSL_LIB_CTX *ctx,
                                      const char *propq);

CMS_ContentInfo *CMS_digest_create(BIO *in, const EVP_MD *md,
                                   unsigned int flags);

πŸ¦‹ DESCRIPTION πŸ¦‹

so CMS_digest_create_ex() builds you a CMS_ContentInfo structure with a type of NID_pkcs7_digest. literally that's its whole thing πŸ’…

The data you hand over via the in BIO gets digested using md. The library context libctx and the property query propq come into play when it's retrieving algorithms from providers β€” iykyk, that's the provider era ✨

The flags field supports the CMS_DETACHED and CMS_STREAM flags. Internally CMS_final() is called β€” unless CMS_STREAM is specified. no cap, that's the rule.

🫢 when you're done with the CMS_ContentInfo structure, free it with CMS_ContentInfo_free(3). clean up after yourself, queen.

CMS_digest_create() is basically the same energy as CMS_digest_create_ex(), except it uses the default values of NULL for the library context libctx and the property query propq. simple. lowkey the easy mode version 🌈


⭐ RETURN VALUES ⭐

If the allocation fails 😭, CMS_digest_create_ex() and CMS_digest_create() return NULL and set an error code that you can obtain with ERR_get_error(3).

Otherwise? they return a pointer to the newly allocated structure. slay πŸ‘‘


πŸ‘€ SEE ALSO πŸ‘€

ERR_get_error(3), CMS_final(3)


πŸ“œ HISTORY πŸ“œ

The CMS_digest_create_ex() method was added in OpenSSL 3.0. so it's a newer-era icon, we respect her πŸ’œ


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


aaand that's the whole page bestie πŸŽ€ this was the 3ossl manual, version 3.5.9, dated 2026-09-29 β€” go digest something iconic, ily, periodt πŸ’…βœ¨

πŸ“¦ where this page comes from