
#use wml::openssl-macros area=docs page=CRYPTO_set_ex_data

<title>Documents, CRYPTO_set_ex_data(3)</title>

<h1>CRYPTO_set_ex_data(3)</h1>

#use wml::imp::generic

{:
## What's this? [[s|(<STRONG>[^<].+?)</A>(</STRONG><DD>)|$1$2|sg]]
[[s|<P>\s+<P>|<P>|sg]]
[[s|<P>\s+</|</|sg]]
[[s|<DD>\s*<DT>|<DD>&nbsp;<DT>|sg]]
[[s|<DD>\s*</DL>|<DD>&nbsp;</DL>|sg]]
[[s|\[|&#91;|sg]]
[[s|\]|&#93;|sg]]

<!-- INDEX BEGIN -->

<UL>

	<LI><A HREF="#NAME">NAME</A>
	<LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
	<LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
	<LI><A HREF="#RETURN_VALUES">RETURN VALUES</A>
	<LI><A HREF="#SEE_ALSO">SEE ALSO</A>
	<LI><A HREF="#HISTORY">HISTORY</A>
</UL>
<!-- INDEX END -->

<HR>
<P>
<HR>
<H1><A NAME="NAME">NAME</A></H1>
<P>
CRYPTO_set_ex_data, CRYPTO_get_ex_data - internal application specific data
functions

</P>
<P>
<HR>
<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
<PRE> #include &lt;openssl/crypto.h&gt;
</PRE>
<PRE> int CRYPTO_set_ex_data(CRYPTO_EX_DATA *r, int idx, void *arg);
</PRE>
<PRE> void *CRYPTO_get_ex_data(CRYPTO_EX_DATA *r, int idx);
</PRE>
<P>
<HR>
<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
<P>
Several OpenSSL structures can have application specific data attached to
them. These functions are used internally by OpenSSL to manipulate
application specific data attached to a specific structure.

</P>
<P>
These functions should only be used by applications to manipulate
<STRONG>CRYPTO_EX_DATA</STRONG> structures passed to the <STRONG>new_func()</STRONG>, <STRONG>free_func()</STRONG> and
<STRONG>dup_func()</STRONG> callbacks: as passed to <STRONG>RSA_get_ex_new_index()</STRONG> for example.

</P>
<P>
<STRONG>CRYPTO_set_ex_data()</STRONG> is used to set application specific data, the data is supplied in the <STRONG>arg</STRONG> parameter and its precise meaning is up to the application.

</P>
<P>
<STRONG>CRYPTO_get_ex_data()</STRONG> is used to retrieve application specific data. The data is returned to the
application, this will be the same value as supplied to a previous <STRONG>CRYPTO_set_ex_data()</STRONG> call.

</P>
<P>
<HR>
<H1><A NAME="RETURN_VALUES">RETURN VALUES</A></H1>
<P>
<STRONG>CRYPTO_set_ex_data()</STRONG> returns 1 on success or 0 on failure.

</P>
<P>
<STRONG>CRYPTO_get_ex_data()</STRONG> returns the application data or 0 on failure. 0 may also be valid
application data but currently it can only fail if given an invalid <STRONG>idx</STRONG>
parameter.

</P>
<P>
On failure an error code can be obtained from <A HREF="../crypto/ERR_get_error.html#">ERR_get_error(3)</A>.

</P>
<P>
<HR>
<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
<P>
<A HREF="../crypto/RSA_get_ex_new_index.html#">RSA_get_ex_new_index(3)</A>,
<A HREF="../crypto/DSA_get_ex_new_index.html#">DSA_get_ex_new_index(3)</A>,
<A HREF="../crypto/DH_get_ex_new_index.html#">DH_get_ex_new_index(3)</A>



</P>
<P>
<HR>
<H1><A NAME="HISTORY">HISTORY</A></H1>
<P>
<CODE>CRYPTO_set_ex_data()</CODE> and <CODE>CRYPTO_get_ex_data()</CODE>
have been available since SSLeay 0.9.0.

</P>
:}

