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

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

<h1>EVP_PKEY_cmp(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>
</UL>
<!-- INDEX END -->

<HR>
<P>
<HR>
<H1><A NAME="NAME">NAME</A></H1>
<P>
EVP_PKEY_copy_parameters, EVP_PKEY_missing_parameters,
EVP_PKEY_cmp_parameters, EVP_PKEY_cmp - public key parameter and comparison
functions

</P>
<P>
<HR>
<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
<PRE> #include &lt;openssl/evp.h&gt;
</PRE>
<PRE> int EVP_PKEY_missing_parameters(const EVP_PKEY *pkey);
 int EVP_PKEY_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from);
</PRE>
<PRE> int EVP_PKEY_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b);
 int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b);
</PRE>
<P>
<HR>
<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
<P>
The function <CODE>EVP_PKEY_missing_parameters()</CODE> returns 1 if the
public key parameters of <STRONG>pkey</STRONG> are missing and 0 if they are present or the algorithm doesn't use
parameters.

</P>
<P>
The function <CODE>EVP_PKEY_copy_parameters()</CODE> copies the parameters
from key
<STRONG>from</STRONG> to key <STRONG>to</STRONG>.

</P>
<P>
The funcion <CODE>EVP_PKEY_cmp_parameters()</CODE> compares the parameters
of keys
<STRONG>a</STRONG> and <STRONG>b</STRONG>.

</P>
<P>
The funcion <CODE>EVP_PKEY_cmp()</CODE> compares the public key components
and paramters (if present) of keys <STRONG>a</STRONG> and <STRONG>b</STRONG>.

</P>
<P>
<HR>
<H1><A NAME="NOTES">NOTES</A></H1>
<P>
The main purpose of the functions
<CODE>EVP_PKEY_missing_parameters()</CODE> and
<CODE>EVP_PKEY_copy_parameters()</CODE> is to handle public keys in
certificates where the parameters are sometimes omitted from a public key
if they are inherited from the CA that signed it.

</P>
<P>
Since OpenSSL private keys contain public key components too the function
<CODE>EVP_PKEY_cmp()</CODE> can also be used to determine if a private key
matches a public key.

</P>
<P>
<HR>
<H1><A NAME="RETURN_VALUES">RETURN VALUES</A></H1>
<P>
The function <CODE>EVP_PKEY_missing_parameters()</CODE> returns 1 if the
public key parameters of <STRONG>pkey</STRONG> are missing and 0 if they are present or the algorithm doesn't use
parameters.

</P>
<P>
These functions <CODE>EVP_PKEY_copy_parameters()</CODE> returns 1 for
success and 0 for failure.

</P>
<P>
The function <CODE>EVP_PKEY_cmp_parameters()</CODE> and
<CODE>EVP_PKEY_cmp()</CODE> return 1 if the keys match, 0 if they don't
match, -1 if the key types are different and -2 if the operation is not
supported.

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

 

</P>
:}


