i need check if x509 certificate's signature algorithm md5 or sha. know can extract nid corresponding signature algorithm:
int sig_nid = obj_obj2nid(cert->sig_alg->algorithm); now problem can't seem find easy way compare against md5 or sha believe multiple nids can returned signature. there easy way compare nid or place find md5 , sha nids long comparison myself?
i think you're after: http://www.alvestrand.no/objectid/1.2.840.113549.1.1.html lists hash/encryption available x509 certificates. can generate nids you're comparing against using obj_txt2nid().
the want compare algorithm nid obj_txt2nid("1.2.840.113549.1.1.4") - or in practice nid_md5withrsaencryption (defined in openssl/objects.h)
edit: add more info: x509v3 rfc refers other rfcs define "acceptable" algorithms. these rfc3279, rfc4055, , rfc4491. include oids can used. first 1 seems define schemes md5 hashing.
Comments
Post a Comment