Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how can i verify the self signed certificate using openssl library in C++?

i need to verify the X509 v3 certificate .the Certificate is self signed so i have the private key and public key with me .

I tried

ki=X509_verify(Cert,X509_get_pubkey(Cert));

i always getting the Ki = -1 . can any one tell me how to do this verification.

like image 555
Balamurugan Avatar asked Oct 28 '25 00:10

Balamurugan


1 Answers

I am answering my own question. before call X509_verify(,) function
OpenSSL_add_all_digests();
this function set the digests algorithm in the local table which is used internally for verification.

like image 140
Balamurugan Avatar answered Oct 29 '25 15:10

Balamurugan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!