What's the best way to compare 2 certs in NSS?

In my NSS server, I want to compare the cert I get from client
(SSL_PeerCertificate) with a cert I pull out of the server's cert db (using
CERT_FindCertByName ). I'm expecting the client to present the same cert the
server is using...

Anyway the best way I saw was to convert the NSS cert structure to a SECItem
item, and then use the SECITEM_CompareItem function.
Is there a better way?

I would recommend putting a CERT_Compare(CERTCertificate *cert1,
CERTCertificate *cert2) in the NSS API. Comparing certs should be a pretty
common operation I would think.

-- Patrick



Reply via email to