Sortix nightly manual
This manual documents Sortix nightly, a development build that has not been officially released. You can instead view this document in the latest official manual.
NAME
X509_TRUST_set, X509_TRUST_get_by_id, X509_TRUST_add, X509_TRUST_get_count, X509_TRUST_cleanup, X509_TRUST_get0, X509_TRUST_get_trust, X509_TRUST_get0_name, X509_TRUST_get_flags — trust objects, indices, and identifiersSYNOPSIS
#include <openssl/x509.h>X509_TRUST_set(int *id_out, int id_in);
X509_TRUST_get_by_id(int identifier);
X509_TRUST_add(int identifier, int flags, int (*check_trust)(X509_TRUST *, X509 *, int), const char *name, int arg1, void *arg2);
X509_TRUST_get_count(void);
X509_TRUST_cleanup(void);
X509_TRUST_get0(int index);
X509_TRUST_get_trust(const X509_TRUST *object);
X509_TRUST_get0_name(const X509_TRUST *object);
X509_TRUST_get_flags(const X509_TRUST *object);
DESCRIPTION
The purposes that an X.509 certificate is trusted for can be identified in three equivalent ways:- By trust identifiers, which are positive integer constants. Standard trust identifiers lie in the range from X509_TRUST_MIN to X509_TRUST_MAX, inclusive. User defined trust identifiers are larger than X509_TRUST_MAX.
- By trust indices, which are non-negative integer constants but differ from the trust identifiers expressing the same kind of trust. Standard trust indices are smaller than X509_TRUST_MAX. User defined trust indices are larger than or equal to X509_TRUST_MAX.
- By trust objects of the type X509_TRUST. Standard trust objects are available in static storage. User defined trust objects can be created with X509_TRUST_add().
Using trust identifiers
X509_TRUST_set() validates the trust identifier id_in. If it is valid, it is copied to *id_out. Otherwise, *id_out remains unchanged.Using trust indices
X509_TRUST_get0() converts the trust index to a pointer to the corresponding trust object. To find the corresponding trust identifier, pass the result to X509_TRUST_get_trust().Using trust objects
X509_TRUST_get_trust() converts a pointer to a trust object to the corresponding trust identifier. To find the corresponding trust index, pass the result to X509_TRUST_get_by_id().RETURN VALUES
X509_TRUST_set() returns 1 if id_in is valid or 0 otherwise.ERRORS
The following diagnostics can be retrieved with ERR_get_error(3), ERR_GET_REASON(3), and ERR_reason_error_string(3):- X509_R_INVALID_TRUST “invalid trust”
- X509_TRUST_set() was called with an invalid id_in argument.
- ERR_R_MALLOC_FAILURE “malloc failure”
- X509_TRUST_add() failed to allocate memory.