NAME
d2i_SSL_SESSION, i2d_SSL_SESSION — convert SSL_SESSION object from/to ASN1 representationSYNOPSIS
#include <openssl/ssl.h>d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp, long length);
i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp);
DESCRIPTION
d2i_SSL_SESSION() transforms the external ASN1 representation of an SSL/TLS session, stored as binary data at location pp with length length, into an SSL_SESSION object.NOTES
The SSL_SESSION object is built from several malloc(3)-ed parts; it can therefore not be moved, copied or stored directly. In order to store session data on disk or into a database, it must be transformed into a binary ASN1 representation.int i, j; char *p, *temp; i = i2d_SSL_SESSION(sess, NULL); p = temp = malloc(i); if (temp != NULL) { j = i2d_SSL_SESSION(sess, &temp); assert(i == j); assert(p + i == temp); }