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

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

<h1>EVP_PKEY_CTX_new(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="#NOTES">NOTES</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>
EVP_PKEY_CTX_new, EVP_PKEY_CTX_new_id, EVP_PKEY_CTX_dup, EVP_PKEY_CTX_free
- public key algorithm context functions.

</P>
<P>
<HR>
<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
<PRE> #include &lt;openssl/evp.h&gt;
</PRE>
<PRE> EVP_PKEY_CTX *EVP_PKEY_CTX_new(EVP_PKEY *pkey, ENGINE *e);
 EVP_PKEY_CTX *EVP_PKEY_CTX_new_id(int id, ENGINE *e);
 EVP_PKEY_CTX *EVP_PKEY_CTX_dup(EVP_PKEY_CTX *ctx);
 void EVP_PKEY_CTX_free(EVP_PKEY_CTX *ctx);
</PRE>
<P>
<HR>
<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
<P>
The <CODE>EVP_PKEY_CTX_new()</CODE> function allocates public key algorithm
context using the algorithm specified in <STRONG>pkey</STRONG> and ENGINE <STRONG>e</STRONG>.

</P>
<P>
The <CODE>EVP_PKEY_CTX_new_id()</CODE> function allocates public key
algorithm context using the algorithm specified by <STRONG>id</STRONG> and ENGINE <STRONG>e</STRONG>. It is normally used when no <STRONG>EVP_PKEY</STRONG> structure is associated with the operations, for example during parameter
generation of key genration for some algorithms.

</P>
<P>
<CODE>EVP_PKEY_CTX_dup()</CODE> duplicates the context <STRONG>ctx</STRONG>.

</P>
<P>
<CODE>EVP_PKEY_CTX_free()</CODE> frees up the context <STRONG>ctx</STRONG>.

</P>
<P>
<HR>
<H1><A NAME="NOTES">NOTES</A></H1>
<P>
The <STRONG>EVP_PKEY_CTX</STRONG> structure is an opaque public key algorithm context used by the OpenSSL
high level public key API. Contexts <STRONG>MUST NOT</STRONG> be shared between threads: that is it is not permissible to use the same
context simultaneously in two threads.

</P>
<P>
<HR>
<H1><A NAME="RETURN_VALUES">RETURN VALUES</A></H1>
<P>
<CODE>EVP_PKEY_CTX_new(),</CODE> <CODE>EVP_PKEY_CTX_new_id(),</CODE>
<CODE>EVP_PKEY_CTX_dup()</CODE> returns either the newly allocated <STRONG>EVP_PKEY_CTX</STRONG> structure of <STRONG>NULL</STRONG> if an error occurred.

</P>
<P>
<CODE>EVP_PKEY_CTX_free()</CODE> does not return a value.

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



</P>
<P>
<HR>
<H1><A NAME="HISTORY">HISTORY</A></H1>
<P>
These functions were first added to OpenSSL 1.0.0.

</P>
:}


