X509_LOAD_CERT_FILE(3)
okay bestie, welcome to the X509_LOAD_CERT_FILE(3) page from the Library Functions Manual β this one is literally all about reading, decoding, and caching certificates and CRLs with libcrypto, and it's lowkey iconic πβ¨
πΈ NAME πΈ
X509_load_cert_file, X509_load_crl_file, X509_load_cert_crl_file β read, decode, and cache certificates and CRLs, periodt π
π SYNOPSIS π
library βlibcryptoβ #include <openssl/x509_vfy.h>
int
X509_load_cert_file(X509_LOOKUP *ctx, const char *file, int type);
int
X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type);
int
X509_load_cert_crl_file(X509_LOOKUP *ctx, const char *file, int type);
π¦ DESCRIPTION π¦
okay so X509_load_cert_file() with a type of X509_FILETYPE_PEM reads one or more certificates in PEM format from the given file using PEM_read_bio_X509_AUX(3); with a type of X509_FILETYPE_ASN1, it reads one certificate in DER format using d2i_X509_bio(3). the certificates that get read are added to the X509_STORE memory cache object associated with the given ctx using X509_STORE_add_cert(3). slay π«Ά
X509_load_crl_file() with a type of X509_FILETYPE_PEM reads one or more certificate revocation lists in PEM format from the given file using PEM_read_bio_X509_CRL(3); with a type of X509_FILETYPE_ASN1, it reads one certificate revocation list in DER format using d2i_X509_CRL_bio(3). the certificate revocation lists that get read are added to the X509_STORE memory cache object associated with the given ctx using X509_STORE_add_crl(3). literally the CRL version of the vibe π
X509_load_cert_crl_file() with a type of X509_FILETYPE_PEM reads one or more certificates and/or certificate revocation lists in PEM format from the given file using PEM_X509_INFO_read_bio(3) and adds them to the X509_STORE memory cache object associated with the given ctx using X509_STORE_add_cert(3) and X509_STORE_add_crl(3), respectively. certs and CRLs in one file? that's giving main character energy fr fr β¨
π¨ bestie, heads up:X509_load_cert_crl_file()with atypeofX509_FILETYPE_ASN1is equivalent toX509_load_cert_file()and cannot be used to read a certificate revocation list. no cap, that's the rule π
π RETURN VALUES π
these functions return the number of objects loaded, or 0 on error. simple as that, bestie π
β SEE ALSO β
d2i_X509_bio(3)PEM_read_PrivateKey(3)X509_LOOKUP_new(3)X509_OBJECT_get0_X509(3)X509_STORE_load_locations(3)X509_STORE_new(3)
π HISTORY π
X509_load_cert_file() first appeared in SSLeay 0.8.0, and X509_load_crl_file() first appeared in SSLeay 0.9.0. these functions have been available since OpenBSD 2.4. iconic longevity behavior π₯
X509_load_cert_crl_file() first appeared in OpenSSL 0.9.5 and has been available since OpenBSD 2.7. she's been around, okay?! π
and that's the whole page, bestie π
brought to you by Debian, dated June 8, 2025, and yes ma'am, this is still the X509_LOAD_CERT_FILE(3) page β periodt π¦πΈ
π¦ 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) 2021 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