c++ - How to use X509_verify() -


how can use x509_verify(). have 2 certificates. first certificate root certificate signed next certificate (which certificate). want check if certificate signed root certificate using x509_verify() in c++. goal keep code simple , understandable can put online.

signature of x509_verify is

 int x509_verify(x509 * x509, evp_pkey * pkey); 

suppose of have root certificate in root , certificate in mycert;

   x509 * root;    x509 * mycert;  //get root certificate root //get mycert mycert.  //get public key. evp_pkey * pubkey = x509_get_pubkey(root);  //verify. result less or 0 means not verified or error. int result = x509_verify(mycert, pubkey);  //free public key. evp_pkey_free(pubkey); 

i think you.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -