libressl-X509_STORE_new(3)

libressl-X509_STORE_new3

Allocate and free x.509 certificate stores

Usage

Crypto Library (libcrypto, -lcrypto)

#include <openssl/x509_vfy.h>

X509_STORE *

X509_STORE_new(void);

int

X509_STORE_up_ref(X509_STORE *store);

void

X509_STORE_free(X509_STORE *store);

Overview

X509_STORE_new() allocates and initializes an empty X.509 certificate store and sets its reference count to 1.

X509_STORE_up_ref() increments the reference count of store by 1.

X509_STORE_free() decrements the reference count of store by 1. If the reference count reaches 0, all resources used by the store, including all certificates contained in it, are released and store itself is freed. If store is a NULL pointer, no action occurs.

Return values

X509_STORE_new() returns a newly created X509_STORE object or NULL if an error occurs.

X509_STORE_up_ref() returns 1 for success and 0 for failure.

History

X509_STORE_new() and X509_STORE_free() first appeared in SSLeay 0.8.0 and have been available since OpenBSD 2.4.

X509_STORE_up_ref() first appeared in OpenSSL 1.1.0 and has been available since OpenBSD 6.3.

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