X509_DIGEST(3)
π X509_DIGEST(3) π
okay bestie, so this is part of libcrypto and it's literally the manual for getting digests of a bunch of X.509-ish objects. no cap, the header on this one is X509_DIGEST(3) β we're in the Library Functions Manual, mwah π
β¨ NAME β¨
X509_digest, X509_CRL_digest, X509_pubkey_digest, X509_NAME_digest, X509_REQ_digest, PKCS7_ISSUER_AND_SERIAL_digest β get digests of various objects π
πΈ SYNOPSIS πΈ
library βlibcryptoβ #include <openssl/x509.h>
int
X509_digest(const X509 *data, const EVP_MD *type, unsigned char *md,
unsigned int *len);
int
X509_CRL_digest(const X509_CRL *data, const EVP_MD *type,
unsigned char *md, unsigned int *len);
int
X509_pubkey_digest(const X509 *data, const EVP_MD *type,
unsigned char *md, unsigned int *len);
int
X509_REQ_digest(const X509_REQ *data, const EVP_MD *type,
unsigned char *md, unsigned int *len);
int
X509_NAME_digest(const X509_NAME *data, const EVP_MD *type,
unsigned char *md, unsigned int *len);
#include <openssl/pkcs7.h>
int
PKCS7_ISSUER_AND_SERIAL_digest(PKCS7_ISSUER_AND_SERIAL *data,
const EVP_MD *type, unsigned char *md, unsigned int *len);
π¦ DESCRIPTION π¦
so here's the tea, bestie β X509_pubkey_digest() gives you a digest of the DER representation of the public key contained in data. and literally all the other functions on this page? they give you a digest of the DER representation of their entire data object. like, the whole thing, no holding back πββοΈ
the type parameter is where you say which digest you want β something like EVP_sha1(3) π
md is a pointer to the buffer where the digest gets copied, and it just assumes the buffer is big enough (rude but okay π). a size of at least EVP_MAX_MD_SIZE bytes is suggested, ngl please listen to that β¨
and the len parameter? if it's not NULL, it points to a place where the digest size gets stored π―
π RETURN VALUES π
these functions return 1 for success or 0 for failure. that's it, that's the vibe check π periodt.
π₯ SEE ALSO π₯
EVP_get_digestbyname(3), X509_cmp(3), X509_CRL_new(3), X509_NAME_new(3), X509_new(3), X509_REQ_new(3) β go read these next bestie, iykyk π«Ά
π HISTORY π
so the lore goes deep, fr fr:
X509_digest(),X509_NAME_digest(), andPKCS7_ISSUER_AND_SERIAL_digest()first appeared in SSLeay 0.6.5 and have been available sinceOpenBSD 2.4. iconic elders π΅β¨X509_CRL_digest()andX509_REQ_digest()first appeared in OpenSSL 0.9.6 and have been available sinceOpenBSD 2.9. glow up era π±X509_pubkey_digest()first appeared in OpenSSL 0.9.7 and has been available sinceOpenBSD 3.2. late bloomer but we love her π¦
and that's the whole page, bestie π this diva came to us from Debian, dated June 8, 2025, and it's the X509_DIGEST(3) manual page β go forth and digest responsibly, mwah ππ
π
π¦ 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) 2017 The OpenSSL Project. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms