libressl-X509_find_by_subject(3)

libressl-X509_find_by_subject3

Search an array of x.509 certificates

Usage

Crypto Library (libcrypto, -lcrypto)

#include <openssl/x509.h>

X509 *

X509_find_by_subject(STACK_OF(X509) *sk, X509_NAME *subject);

X509 *

X509_find_by_issuer_and_serial(STACK_OF(X509) *sk, X509_NAME *issuer, ASN1_INTEGER *serial);

Overview

X509_find_by_subject() searches the variable-sized array sk for a certificate with a matching subject name.

X509_find_by_issuer_and_serial() searches the array for a certificate where both the issuer name and the serial number match the arguments.

Return values

These functions return a pointer to the first matching certificate or NULL if sk is NULL or does not contain a matching certificate.

History

These functions first appeared in SSLeay 0.8.1 and have been available since OpenBSD 2.4.

From libressl 4.4.0-1 in Arch Linux 2026-11-07. Parsed by carta from the page's mdoc source.