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.
|PEM_X509_INFO_READ(3)||Library Functions Manual||PEM_X509_INFO_READ(3)|
PEM and DER decode X.509 certificates, private keys, and revocation lists
#include <openssl/pem.h>STACK_OF(X509_INFO) *
PEM_X509_INFO_read(FILE *in_fp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, void *u); STACK_OF(X509_INFO) *
PEM_X509_INFO_read_bio(BIO *in_bp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, void *u);
NULLis recommended, in which case a new stack is allocated, populated, and returned. If an existing sk is passed in, the created X509_INFO objects are pushed onto that stack. For PEM decoding, PEM_read_bio(3) is used internally, implying that any non-PEM data before, between, and after the objects is silently discarded. For subsequent DER decoding, the decoding function and the field of the X509_INFO structure to store the new object in are selected according to the PEM type name:
|PEM type name||decoder||X509_INFO field|
|X509 CRL||d2i_X509_CRL(3)||revocation list|
|RSA PRIVATE KEY||d2i_PrivateKey(3)||private key|
|DSA PRIVATE KEY||d2i_PrivateKey(3)||private key|
|EC PRIVATE KEY||d2i_PrivateKey(3)||private key|
NULLif an error occurs. They fail if PEM_read_bio(3), PEM_get_EVP_CIPHER_INFO(3), PEM_do_header(3), or DER decoding fails or if memory is exhausted. ERR_get_error(3), ERR_GET_REASON(3), and ERR_reason_error_string(3) include:
- DER decoding of a PEM object failed.
PEM_X509_INFO_read() failed to set up a temporary BIO, for example because memory was exhausted.
PEM_X509_INFO_read_bio() failed to allocate a new X509_INFO, STACK_OF(X509_INFO), or X509_PKEY object.
PEM_X509_INFO_read() first appeared in SSLeay 0.5.1 and
PEM_X509_INFO_read_bio() in SSLeay 0.6.0. Both functions have been available since OpenBSD 2.4.
NULL, a newly allocated, empty stack is returned. The only way to detect this situation is by comparing the number of objects on the stack before and after the call. ERR_clear_error(3), which may hide errors that occurred before calling these functions.
|October 19, 2021||Debian|