|X509_NEW(3)||Library Functions Manual||X509_NEW(3)|
X509_new() allocates and initializes an empty X509 object with reference count 1. It represents an ASN.1 Certificate structure defined in RFC 5280 section 4.1. It can hold a public key together with information about the person, organization, device, or function the associated private key belongs to.
X509_free() decrements the reference count
of the X509 structure a and
frees it up if the reference count reaches 0. If a is
NULL pointer, no action occurs.
X509_up_ref() increments the reference
count of a by 1. This function is useful if a
certificate structure is being used by several different operations each of
which will free it up after use: this avoids the need to duplicate the
entire certificate structure.
X509_chain_up_ref() performs a shallow
copy of the given chain using
sk_X509_dup() and increments the reference count of
each contained certificate by 1. Its purpose is similar to
X509_up_ref(): The returned chain persists after the
original is freed.
The object X509_INFO, which can hold a certificate, the corresponding private key, and a certificate revocation list, is not yet documented.
NULLand sets an error code that can be obtained by ERR_get_error(3). Otherwise it returns a pointer to the newly allocated structure.
X509_up_ref() returns 1 for success or 0
X509_chain_up_ref() returns the copy of
the chain or
NULL if an error
X509_free() appeared in SSLeay 0.4 or earlier and have been available since OpenBSD 2.4.
X509_up_ref() first appeared in OpenSSL
1.1.0 and has been available since OpenBSD 6.1.
X509_chain_up_ref() first appeared in
OpenSSL 1.0.2 and has been available since OpenBSD
|June 10, 2019||OpenBSD-current|