d2i_SSL_SESSION.pod revision 76866
172613Skris=pod 272613Skris 372613Skris=head1 NAME 476866Skris 572613Skrisd2i_SSL_SESSION, i2d_SSL_SESSION - convert SSL_SESSION object from/to ASN1 representation 672613Skris 772613Skris=head1 SYNOPSIS 872613Skris 972613Skris #include <openssl/ssl.h> 1072613Skris 1172613Skris SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, unsigned char **pp, long length); 1272613Skris int i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp); 1372613Skris 1472613Skris=head1 DESCRIPTION 1572613Skris 1672613Skrisd2i_SSL_SESSION() transforms the external ASN1 representation of an SSL/TLS 1772613Skrissession, stored as binary data at location B<pp> with length B<length>, into 1872613Skrisan SSL_SESSION object. 1972613Skris 2072613Skrisi2d_SSL_SESSION() transforms the SSL_SESSION object B<in> into the ASN1 2172613Skrisrepresentation and stores it into the memory location pointed to by B<pp>. 2272613SkrisThe length of the resulting ASN1 representation is returned. If B<pp> is 2372613Skristhe NULL pointer, only the length is calculated and returned. 2472613Skris 2572613Skris=head1 NOTES 2672613Skris 2772613SkrisThe SSL_SESSION object is built from several malloc()ed parts, it can 2872613Skristherefore not be moved, copied or stored directly. In order to store 2972613Skrissession data on disk or into a database, it must be transformed into 3072613Skrisa binary ASN1 representation. 3172613Skris 3272613SkrisWhen using d2i_SSL_SESSION(), the SSL_SESSION object is automatically 3372613Skrisallocated. 3472613Skris 3572613SkrisWhen using i2d_SSL_SESSION(), the memory location pointed to by B<pp> must be 3672613Skrislarge enough to hold the binary representation of the session. There is no 3772613Skrisknown limit on the size of the created ASN1 representation, so the necessary 3872613Skrisamount of space should be obtained by first calling i2d_SSL_SESSION() with 3972613SkrisB<pp=NULL>, and obtain the size needed, then allocate the memory and 4072613Skriscall i2d_SSL_SESSION() again. 4172613Skris 4272613Skris=head1 RETURN VALUES 4372613Skris 4472613Skrisd2i_SSL_SESSION() returns a pointer to the newly allocated SSL_SESSION 4572613Skrisobject. In case of failure the NULL-pointer is returned and the error message 4672613Skriscan be retrieved from the error stack. 4772613Skris 4872613Skrisi2d_SSL_SESSION() returns the size of the ASN1 representation in bytes. 4972613SkrisWhen the session is not valid, B<0> is returned and no operation is performed. 5072613Skris 5172613Skris=head1 SEE ALSO 5272613Skris 5372613SkrisL<ssl(3)|ssl(3)>, 5472613SkrisL<SSL_CTX_sess_set_get_cb(3)|SSL_CTX_sess_set_get_cb(3)> 5572613Skris 5672613Skris=cut 57