| Index: net/cert/x509_certificate_nss.cc
|
| diff --git a/net/cert/x509_certificate_nss.cc b/net/cert/x509_certificate_nss.cc
|
| index 9019625869aacf35bcf3280a4733eeb2bac5ccc6..05ca13ba4526e74b0e05581c54cc5d8333a06ac0 100644
|
| --- a/net/cert/x509_certificate_nss.cc
|
| +++ b/net/cert/x509_certificate_nss.cc
|
| @@ -266,4 +266,15 @@ void X509Certificate::GetPublicKeyInfo(OSCertHandle cert_handle,
|
| x509_util::GetPublicKeyInfo(cert_handle, size_bits, type);
|
| }
|
|
|
| +// static
|
| +bool X509Certificate::IsSelfSigned(OSCertHandle cert_handle) {
|
| + SECKEYPublicKey* public_key = CERT_ExtractPublicKey(cert_handle);
|
| + if (!public_key)
|
| + return false;
|
| +
|
| + SECStatus verified = CERT_VerifySignedDataWithPublicKey(
|
| + &cert_handle->signatureWrap, public_key, NULL);
|
| + return verified == SECSuccess;
|
| +}
|
| +
|
| } // namespace net
|
|
|