Manual Pages for UNIX Darwin command on man i2d_SSL_SESSION
MyWebUniversity

Manual Pages for UNIX Darwin command on man i2d_SSL_SESSION

d2iSSLSESSION(3) OpenSSL d2iSSLSESSION(3)

NAME

d2iSSLSESSION, i2dSSLSESSION - convert SSLSESSION object from/to

ASN1 representation

SYNOPSIS

#include

SSLSESSION *d2iSSLSESSION(SSLSESSION **a, const unsigned char **pp, long length); int i2dSSLSESSION(SSLSESSION *in, unsigned char **pp);

DESCRIPTION

d2iSSLSESSION() transforms the external ASN1 representation of an SSL/TLS session, stored as binary data at location pppp with length lleennggtthh, into an SSLSESSION object. i2dSSLSESSION() transforms the SSLSESSION object iinn into the ASN1 representation and stores it into the memory location pointed to by pppp. The length of the resulting ASN1 representation is returned. If pppp is the NULL pointer, only the length is calculated and returned. NNOOTTEESS The SSLSESSION object is built from several malloc()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. When using d2iSSLSESSION(), the SSLSESSION object is automatically allocated. The reference count is 1, so that the session must be explicitly removed using SSLSESSIONfree(3), unless the SSLSESSION object is completely taken over, when being called inside the getsessioncb() (see SSLCTXsesssetgetcb(3)). SSLSESSION objects keep internal link information about the session cache list, when being inserted into one SSLCTX object's session cache. One SSLSESSION object, regardless of its reference count, must therefore only be used with one SSLCTX object (and the SSL objects created from this SSLCTX object). When using i2dSSLSESSION(), the memory location pointed to by pppp must be large enough to hold the binary representation of the session. There is no known limit on the size of the created ASN1 representation, so the necessary amount of space should be obtained by first calling i2dSSLSESSION() with pppp==NNUULLLL, and obtain the size needed, then allocate the memory and call i2dSSLSESSION() again.

RETURN VALUES

d2iSSLSESSION() returns a pointer to the newly allocated SSLSESSION

object. In case of failure the NULL-pointer is returned and the error

message can be retrieved from the error stack. i2dSSLSESSION() returns the size of the ASN1 representation in bytes. When the session is not valid, 00 is returned and no operation is performed.

SEE ALSO

ssl(3), SSLSESSIONfree(3), SSLCTXsesssetgetcb(3)

0.9.7l 2005-03-30 d2iSSLSESSION(3)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™