d2i_X509_bio man page on Archlinux
d2i_X509(3) OpenSSL d2i_X509(3)
d2i_X509, i2d_X509, d2i_X509_bio, d2i_X509_fp, i2d_X509_bio,
i2d_X509_fp - X509 encode and decode functions
X509 *d2i_X509(X509 **px, const unsigned char **in, int len);
int i2d_X509(X509 *x, unsigned char **out);
X509 *d2i_X509_bio(BIO *bp, X509 **x);
X509 *d2i_X509_fp(FILE *fp, X509 **x);
int i2d_X509_bio(BIO *bp, X509 *x);
int i2d_X509_fp(FILE *fp, X509 *x);
The X509 encode and decode routines encode and parse an X509 structure,
which represents an X509 certificate.
d2i_X509() attempts to decode len bytes at *in. If successful a pointer
to the X509 structure is returned. If an error occurred then NULL is
returned. If px is not NULL then the returned structure is written to
*px. If *px is not NULL then it is assumed that *px contains a valid
X509 structure and an attempt is made to reuse it. If the call is
successful *in is incremented to the byte following the parsed data.
i2d_X509() encodes the structure pointed to by x into DER format. If
out is not NULL is writes the DER encoded data to the buffer at *out,
and increments it to point after the data just written. If the return
value is negative an error occurred, otherwise it returns the length of
the encoded data.