<html><body>
<p><font size="2" face="sans-serif">OK.. I think I understood this API wrongly then.</font><br>
<font size="2" face="sans-serif"><br>
What will X509_verify() will verify if I pass it public key.</font><br>
<br>
<font size="2" face="sans-serif">I mean in place of private key , if I try to match the public key than rather than doing keys comparision, will passing the public key to this API, help ?</font><br>
<br>
<font size="2" face="sans-serif">I mean does it check the private key with which certificate was signed, or the public key which this certificate signs.</font><br>
<br>
<font size="2" face="sans-serif">Sorry, I think I am still bit not clear on purpose of the API.</font><br>
<br>
<font size="2" face="sans-serif">Thanks & Regards,<br>
Nayna Jain</font><br>
<br>
<img width="16" height="16" src="cid:1__=EABBF4FFDF8143818f9e8a93df938@in.ibm.com" border="0" alt="Inactive hide details for Viktor Dukhovni ---06/22/2015 08:00:19 AM---On Mon, Jun 22, 2015 at 07:56:37AM +0530, Nayna Jain wrot"><font size="2" color="#424282" face="sans-serif">Viktor Dukhovni ---06/22/2015 08:00:19 AM---On Mon, Jun 22, 2015 at 07:56:37AM +0530, Nayna Jain wrote: > I want to match the certificate with t</font><br>
<br>
<font size="1" color="#5F5F5F" face="sans-serif">From:      </font><font size="1" face="sans-serif">Viktor Dukhovni <openssl-users@dukhovni.org></font><br>
<font size="1" color="#5F5F5F" face="sans-serif">To:        </font><font size="1" face="sans-serif">openssl-users@openssl.org, openssl-dev@openssl.org</font><br>
<font size="1" color="#5F5F5F" face="sans-serif">Date:      </font><font size="1" face="sans-serif">06/22/2015 08:00 AM</font><br>
<font size="1" color="#5F5F5F" face="sans-serif">Subject:   </font><font size="1" face="sans-serif">Re: [openssl-dev] [openssl-users] X509_verify() error - block   type    is not 01</font><br>
<font size="1" color="#5F5F5F" face="sans-serif">Sent by:   </font><font size="1" face="sans-serif">"openssl-dev" <openssl-dev-bounces@openssl.org></font><br>
<hr width="100%" size="2" align="left" noshade style="color:#8091A5; "><br>
<br>
<br>
<tt><font size="2">On Mon, Jun 22, 2015 at 07:56:37AM +0530, Nayna Jain wrote:<br>
<br>
> I want to match the certificate with the private key for whose public key<br>
> that certificate is provided.<br>
<br>
That's the subject key, and unless the certificate is self-signed,<br>
the X509_verify() function is not the right interface.  You want<br>
to extract the certificate's public key and compare it with the<br>
key you have.  You can compare (memcmp()) the DER encoding of <br>
the public key from the certificate with the DER encoding of<br>
the desired key.<br>
<br>
> If this verifies who signed the certificate, then how do I verify whether<br>
> the certificate provided is for the private key which was generated,<br>
<br>
You compare the keys, or the key fingerprints.<br>
<br>
-- <br>
                 Viktor.<br>
_______________________________________________<br>
openssl-dev mailing list<br>
To unsubscribe: </font></tt><tt><font size="2"><a href="https://mta.openssl.org/mailman/listinfo/openssl-dev">https://mta.openssl.org/mailman/listinfo/openssl-dev</a></font></tt><tt><font size="2"><br>
<br>
</font></tt><br>
</body></html>