---
name: "libressl-X509_STORE_set1_param"
section: "3"
platform: "linux"
package: "libressl"
version: "4.4.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libressl-X509_STORE_set1_param"
---

# libressl-X509\_STORE\_set1\_param(3)

get and set X509\_STORE data

## NAME

**X509\_STORE\_set1\_param**, **X509\_STORE\_set\_flags**, **X509\_STORE\_set\_purpose**, **X509\_STORE\_set\_trust**, **X509\_STORE\_set\_depth**, **X509\_STORE\_add\_cert**, **X509\_STORE\_add\_crl**, **X509\_STORE\_get0\_param**, **X509\_STORE\_get1\_objects**, **X509\_STORE\_get0\_objects**, **X509\_STORE\_get\_ex\_new\_index**, **X509\_STORE\_set\_ex\_data**, **X509\_STORE\_get\_ex\_data** – get and set X509\_STORE data

## SYNOPSIS

Crypto Library (libcrypto, -lcrypto)

**#include \<openssl/x509\_vfy.h\>**

*int*\

**X509\_STORE\_set1\_param**(*X509\_STORE \*store*, *X509\_VERIFY\_PARAM \*pm*);

*int*\

**X509\_STORE\_set\_flags**(*X509\_STORE \*store*, *unsigned long flags*);

*int*\

**X509\_STORE\_set\_purpose**(*X509\_STORE \*store*, *int purpose*);

*int*\

**X509\_STORE\_set\_trust**(*X509\_STORE \*store*, *int trust*);

*int*\

**X509\_STORE\_set\_depth**(*X509\_STORE \*store*, *int depth*);

*int*\

**X509\_STORE\_add\_cert**(*X509\_STORE \*store*, *X509 \*x*);

*int*\

**X509\_STORE\_add\_crl**(*X509\_STORE \*store*, *X509\_CRL \*crl*);

*X509\_VERIFY\_PARAM* *\**\

**X509\_STORE\_get0\_param**(*X509\_STORE \*store*);

*STACK\_OF(X509\_OBJECT)* *\**\

**X509\_STORE\_get1\_objects**(*X509\_STORE \*store*);

*STACK\_OF(X509\_OBJECT)* *\**\

**X509\_STORE\_get0\_objects**(*X509\_STORE \*store*);

*int*\

**X509\_STORE\_get\_ex\_new\_index**(*long argl*, *void \*argp*, *CRYPTO\_EX\_new \*new\_func*, *CRYPTO\_EX\_dup \*dup\_func*, *CRYPTO\_EX\_free \*free\_func*);

*int*\

**X509\_STORE\_set\_ex\_data**(*X509\_STORE \*store*, *int idx*, *void \*arg*);

*void* *\**\

**X509\_STORE\_get\_ex\_data**(*X509\_STORE \*store*, *int idx*);

## DESCRIPTION

**X509\_STORE\_set1\_param**() copies the verification parameters from *pm* using X509\_VERIFY\_PARAM\_set1(3) into the verification parameter object contained in the *store*.

**X509\_VERIFY\_PARAM\_set\_flags**(), **X509\_STORE\_set\_purpose**(), **X509\_STORE\_set\_trust**(), and **X509\_STORE\_set\_depth**() call **X509\_VERIFY\_PARAM\_set\_flags**(), **X509\_VERIFY\_PARAM\_set\_purpose**(), **X509\_VERIFY\_PARAM\_set\_trust**(), and **X509\_VERIFY\_PARAM\_set\_depth**() on the verification parameter object contained in the *store*.

**X509\_STORE\_add\_cert**() and **X509\_STORE\_add\_crl**() add the certificate *x* or the certificate revocation list *crl* to the *store*, increasing its reference count by 1 in case of success. Untrusted objects should not be added in this way.

**X509\_STORE\_get\_ex\_new\_index**(), **X509\_STORE\_set\_ex\_data**(), and **X509\_STORE\_get\_ex\_data**() handle application specific data in *X509\_STORE* objects. Their usage is identical to that of RSA\_get\_ex\_new\_index(3), RSA\_set\_ex\_data(3), and RSA\_get\_ex\_data(3). **X509\_STORE\_get\_ex\_new\_index**() is implemented as a macro.

## RETURN VALUES

**X509\_STORE\_set1\_param**(), **X509\_STORE\_set\_purpose**(), **X509\_STORE\_set\_trust**(), and **X509\_STORE\_set\_ex\_data**() return 1 for success or 0 for failure.

**X509\_STORE\_set\_flags**() and **X509\_STORE\_set\_depth**() always return 1, indicating success.

**X509\_STORE\_add\_cert**() and **X509\_STORE\_add\_crl**() return 1 for success or 0 for failure. For example, they fail if *x* or *crl* is a NULL pointer, if a certificate with the same subject name as *x* or a revocation list with the same issuer name as *crl* are already contained in the *store*, or if memory allocation fails.

**X509\_STORE\_get0\_param**() returns an internal pointer to the verification parameter object contained in the *store*. The returned pointer must not be freed by the calling application.

**X509\_STORE\_get1\_objects**() returns a newly allocated stack containing the certificates, revocation lists, and private keys in *store*, as well as cached objects added by X509\_LOOKUP\_hash\_dir(3). The caller must release the result with sk\_pop\_free(3) and X509\_OBJECT\_free(3) when done.

**X509\_STORE\_get0\_objects**() is a deprecated function returning an internal pointer to the stack of certificates, revocation lists, and private keys contained in *store*. The returned pointer must not be modified or freed by the calling application. This function is not thread-safe. If *store* is shared across multiple threads, callers cannot safely inspect the result of this function, because another thread may have concurrently added to it. In particular, X509\_LOOKUP\_hash\_dir(3) treats this list as a cache and may add to it in the course of certificate verification.

**X509\_STORE\_get\_ex\_new\_index**() returns a new index or -1 on failure.

**X509\_STORE\_get\_ex\_data**() returns the application data or NULL on failure.

## SEE ALSO

RSA\_get\_ex\_new\_index(3), SSL\_set1\_param(3), X509\_LOOKUP\_new(3), X509\_OBJECT\_get0\_X509(3), X509\_STORE\_CTX\_set0\_param(3), X509\_STORE\_load\_locations(3), X509\_STORE\_new(3), X509\_VERIFY\_PARAM\_new(3), X509\_VERIFY\_PARAM\_set\_flags(3)

## HISTORY

**X509\_STORE\_add\_cert**() first appeared in SSLeay 0.8.0. **X509\_STORE\_add\_crl**() first appeared in SSLeay 0.9.0. These functions have been available since OpenBSD 2.4.

**X509\_STORE\_set\_flags**(), **X509\_STORE\_set\_purpose**(), and **X509\_STORE\_set\_trust**() first appeared in OpenSSL 0.9.7 and have been available since OpenBSD 3.2.

**X509\_STORE\_set1\_param**() and **X509\_STORE\_set\_depth**() first appeared in OpenSSL 0.9.8 and have been available since OpenBSD 4.5.

**X509\_STORE\_get0\_param**(), **X509\_STORE\_get0\_objects**(), **X509\_STORE\_get\_ex\_new\_index**(), **X509\_STORE\_set\_ex\_data**(), and **X509\_STORE\_get\_ex\_data**() first appeared in OpenSSL 1.1.0 and have been available since OpenBSD 6.3.

**X509\_STORE\_get1\_objects**() first appeared in BoringSSL and has been available since OpenBSD 7.5.
