X509_SIG_NEW(3)

πŸ“¦ version 4.4.0, in alpine 3.24, arch rolling

πŸ’… X509_SIG_NEW(3) β€” the short little page about PKCS#7 digest info πŸŽ€

okay so bestie, we're in the libcrypto library section of the manual, and this page is about two tiny functions that are honestly giving "small but mighty" energy ✨


🌸 NAME 🌸

X509_SIG_new, X509_SIG_free β€” PKCS#7 digest information. that's the whole name section, she's concise and we respect it πŸ’…


✨ SYNOPSIS ✨

first things first, you gotta pull in the library:

library β€œlibcrypto” #include <openssl/x509.h>

then the two superstars:

X509_SIG *
X509_SIG_new(void);

void
X509_SIG_free(X509_SIG *sig);

no args for the first one, one pointer for the second, we love a low-maintenance API 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so X509_SIG_new() is the allocator girlie β€” she allocates and initializes an empty X509_SIG object for you. and what even is that object? it represents an ASN.1 DigestInfo structure, which is defined in RFC 2315 section 9.4 and, equivalently (yes, same thing, different paper πŸ’€), in RFC 8017 section 9.2.

and what does this lil structure actually hold? a message digest together with information about the algorithm that was used. that's it. that's the whole vibe. πŸ”₯

then we have X509_SIG_free(), whose entire job is to free sig. one function, one job, main character energy πŸ‘‘

lowkey important reminder: you allocate with X509_SIG_new(), you clean up with X509_SIG_free(). don't be out here leaking, bestie 😭

πŸŽ€ RETURN VALUES πŸŽ€

X509_SIG_new() hands you back the brand new X509_SIG object... or NULL if an error occurs. so yeah, check your pointer before you go dereferencing it, iykyk πŸ™ˆ


🌈 SEE ALSO 🌈

all the friends in the group chat, go read them too 🧚


⭐ STANDARDS ⭐

  • RFC 2315: PKCS #7: Cryptographic Message Syntax, section 9: Signed-data content type
  • RFC 8017: PKCS #1: RSA Cryptography Specifications, section 9: Encoding Methods for Signatures

like, the receipts are right there, we love a documented queen πŸ’œ


πŸ“ HISTORY πŸ“

so this is kind of iconic β€” X509_SIG_new() and X509_SIG_free() appeared in SSLeay 0.4 or earlier (yes, earlier, they've been around that long πŸ’€) and they've been available since OpenBSD 2.4. vintage. antique. legendary. πŸ’–


and that's the whole page, bestie β€” slay, you read it all 🌸

this lil piece of documentation came from Debian, dated June 8, 2025, and it lives at X509_SIG_NEW(3). mwah, see you in the next man page πŸ’‹πŸŽ€

πŸ“¦ where this page comes from