CMS_DIGEST_CREATE(3ossl)

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

πŸ’… CMS_DIGEST_CREATE

ok so this page is from the 3ossl manual β€” that's the OpenSSL section 3 club, bestie, we're in library-function territory πŸŽ€

✨ NAME ✨

CMS_digest_create_ex, CMS_digest_create β€” these two girlies 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);

like, copy that exactly, no cap 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so CMS_digest_create_ex() builds you a CMS_ContentInfo structure with a type of NID_pkcs7_digest β€” that's the whole vibe ✨

The data you hand over via the in BIO gets digested using md, periodt. And when it comes to pulling algorithms out of providers, the library context libctx and the property query propq are the two that get used πŸ”₯

The flags field supports the CMS_DETACHED and CMS_STREAM flags. Internally, CMS_final() gets called β€” unless CMS_STREAM is specified, so like... watch out for that one πŸ‘€

When you're done with the CMS_ContentInfo structure, you can free it with CMS_ContentInfo_free(3), iconic πŸ’…

CMS_digest_create() is literally similar to CMS_digest_create_ex() BUT it just uses default values of NULL for the library context libctx and the property query propq. lowkey the chill 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 grab with ERR_get_error(3) 😭

Otherwise? They return a pointer to the newly allocated structure. slay πŸ’–


⭐ SEE ALSO ⭐

go read those next, iykyk 🧚


πŸŽ€ HISTORY πŸŽ€

The CMS_digest_create_ex() method was added in OpenSSL 3.0 β€” so she's a 3.0 baby, not that old fr fr 🌸


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

bestie pls actually read the license before you go wild, it's giving "legal but make it cute" πŸ™ˆ

and that's the whole page!! this one's living in version 3.5.0, dated 2026-09-25 β€” mwah, go digest something πŸ’…βœ¨πŸ“

πŸ“¦ where this page comes from