CMS_DIGEST_CREATE(3ossl)
π CMS_DIGEST_CREATE(3ossl) β bestie edition
okay so you found the CMS_DIGEST_CREATE(3ossl) page in the OpenSSL 3ossl manual and you're like "what does this even do" β don't worry, I got you. Pull up a chair. π«Ά
β¨ NAME β¨
CMS_digest_create_ex, CMS_digest_create β Create CMS DigestedData object
Like, the whole point is making a DigestedData object. That's it. That's the vibe. π
πΈ 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);
Two functions, one job. Slay. β¨
π¦ DESCRIPTION π¦
So CMS_digest_create_ex() builds you a CMS_ContentInfo structure with a type of NID_pkcs7_digest. The data you hand over via the in BIO gets digested using md. That's the whole mood. π₯
The library context libctx and the property query propq are used when retrieving algorithms from providers. (Yes, the description says libctx while the synopsis says ctx β same bestie, different nickname, no cap. π)
The flags field supports the CMS_DETACHED and CMS_STREAM flags. Internally CMS_final() is called unless CMS_STREAM is specified β so if you pass CMS_STREAM, that final call just doesn't happen. Noted. β
When you're done with your CMS_ContentInfo structure, free it with CMS_ContentInfo_free(3). Clean up after yourself, icon behaviour only. π
CMS_digest_create() is basically CMS_digest_create_ex()'s lowkey sibling β it does the same thing but uses default values of NULL for the library context libctx and the property query propq. Simple. Done. Periodt. π
π 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. Iconic. π
π SEE ALSO π
π§ HISTORY π§
The CMS_digest_create_ex() method was added in OpenSSL 3.0. Newer edition, elevated energy. β
π COPYRIGHT π
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>.
real talk bestie: none of this is dangerous or deprecated, it's just a digest object. But do remember to CMS_ContentInfo_free(3) your stuff, okay? Memory leaks are not the aesthetic. π«Ά
and that's the whole page!! mwah π this was version 3.5.6, dated 2026-04-07 β go forth and digest, you gorgeous genius π¦β¨π
π¦ where this page comes from
- freebsd 15.1: base 15.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms