X509_SIG_NEW(3)
π 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 withX509_SIG_new(), you clean up withX509_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
- alpine 3.24: libressl-doc 4.3.1-r0 Β· custom
- arch rolling: libressl 4.4.0-1 Β· ISC AND custom:OpenSSL
- Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms