X509_build_chain

Build a certificate chain for target using untrusted certs and trusted store.

Synopsis

Declared in <openssl/x509_vfy.h>

stack_st_X509*
X509_build_chain(
    X509* target,
    stack_st_X509* certs,
    X509_STORE* store,
    int with_self_signed,
    OSSL_LIB_CTX* libctx,
    char const* propq);

Return Value

Newly allocated chain stack (caller frees with sk_X509_pop_free), or NULL on failure.

Parameters

NameDescription
targetEnd-entity certificate to chain up from.
certsOptional untrusted intermediate certificates, or NULL.
storeTrusted certificate store used for trust anchors, or NULL.
with_self_signedNon-zero to include a self-signed trust anchor in the result.
libctxLibrary context for algorithm fetches, or NULL for the default.
propqProperty query string, or NULL.