Lines Matching full:cert
5 #include "net/cert/nss_cert_database.h"
7 #include <cert.h>
30 #include "net/cert/cert_database.h"
31 #include "net/cert/internal/trust_store_nss.h"
32 #include "net/cert/x509_certificate.h"
33 #include "net/cert/x509_util_nss.h"
81 bool IsUntrustedUsingTrustStore(const CERTCertificate* cert, in IsUntrustedUsingTrustStore() argument
92 if (SECITEM_CompareItem(&cert->derIssuer, &cert->derSubject) == SECEqual) { in IsUntrustedUsingTrustStore()
108 ScopedCERTCertificate cert, in ImportCertFailure() argument
110 : certificate(std::move(cert)), net_error(err) {} in ImportCertFailure()
171 bool NSSCertDatabase::IsCertificateOnSlot(CERTCertificate* cert, in IsCertificateOnSlot() argument
176 return PK11_FindCertInSlot(slot, cert, nullptr) != CK_INVALID_HANDLE; in IsCertificateOnSlot()
214 bool NSSCertDatabase::SetCertTrust(CERTCertificate* cert, in SetCertTrust() argument
217 bool success = psm::SetCertTrust(cert, type, trust_bits); in SetCertTrust()
290 int NSSCertDatabase::ImportUserCert(CERTCertificate* cert) { in ImportUserCert() argument
291 int result = psm::ImportUserCert(cert, GetPublicSlot()); in ImportUserCert()
324 // to set a server cert as trusted isn't hooked up anywhere currently, but in ImportServerCert()
329 const CERTCertificate* cert, in GetCertTrust() argument
332 SECStatus srv = CERT_GetCertTrust(cert, &trust); in GetCertTrust()
375 bool NSSCertDatabase::DeleteCertAndKey(CERTCertificate* cert) { in DeleteCertAndKey() argument
377 // cert was probably a client cert, and if not, it may have been a trust in DeleteCertAndKey()
378 // anchor or intemediate CA cert. This is used as a simple approximation as in DeleteCertAndKey()
381 switch (DeleteCertAndKeyImpl(cert)) { in DeleteCertAndKey()
393 void NSSCertDatabase::DeleteCertAndKeyAsync(ScopedCERTCertificate cert, in DeleteCertAndKeyAsync() argument
399 std::move(cert)), in DeleteCertAndKeyAsync()
405 bool NSSCertDatabase::IsUntrusted(const CERTCertificate* cert) { in IsUntrusted() argument
407 SECStatus rv = CERT_GetCertTrust(cert, &nsstrust); in IsUntrusted()
420 // end-entity or intermediate CA cert. in IsUntrusted()
448 if (SECITEM_CompareItem(&cert->derIssuer, &cert->derSubject) == SECEqual) { in IsUntrusted()
458 bool NSSCertDatabase::IsWebTrustAnchor(const CERTCertificate* cert) { in IsWebTrustAnchor() argument
460 SECStatus rv = CERT_GetCertTrust(cert, &nsstrust); in IsWebTrustAnchor()
467 // SECTrustType trustSSL would classify |cert| as a trust anchor. in IsWebTrustAnchor()
479 bool NSSCertDatabase::IsReadOnly(const CERTCertificate* cert) { in IsReadOnly() argument
480 PK11SlotInfo* slot = cert->slot; in IsReadOnly()
485 bool NSSCertDatabase::IsHardwareBacked(const CERTCertificate* cert) { in IsHardwareBacked() argument
486 PK11SlotInfo* slot = cert->slot; in IsHardwareBacked()
498 slot, const_cast<CERTCertificate*>(cert), nullptr); in IsHardwareBacked()
528 certs.push_back(std::move(cert_info.cert)); in ExtractCertificates()
569 cert_info.cert = x509_util::DupCERTCertificate(node.cert.get()); in ListCertsInfoImpl()
572 IsUntrustedUsingTrustStore(cert_info.cert.get(), node.trust); in ListCertsInfoImpl()
574 cert_info.on_read_only_slot = IsReadOnly(cert_info.cert.get()); in ListCertsInfoImpl()
575 cert_info.hardware_backed = IsHardwareBacked(cert_info.cert.get()); in ListCertsInfoImpl()
601 cert_info.cert = x509_util::DupCERTCertificate(node->cert); in ListCertsInfoImpl()
604 cert_info.on_read_only_slot = IsReadOnly(cert_info.cert.get()); in ListCertsInfoImpl()
605 cert_info.untrusted = IsUntrusted(cert_info.cert.get()); in ListCertsInfoImpl()
606 cert_info.web_trust_anchor = IsWebTrustAnchor(cert_info.cert.get()); in ListCertsInfoImpl()
607 cert_info.hardware_backed = IsHardwareBacked(cert_info.cert.get()); in ListCertsInfoImpl()
620 // cert was probably a client cert, and if not, it may have been a trust in NotifyCertRemovalAndCallBack()
621 // anchor or intemediate CA cert. in NotifyCertRemovalAndCallBack()
647 CERTCertificate* cert) { in DeleteCertAndKeyImpl() argument
658 // delete the cert. in DeleteCertAndKeyImpl()
659 SECKEYPrivateKey* privKey = PK11_FindKeyByAnyCert(cert, nullptr); in DeleteCertAndKeyImpl()
662 if (PK11_DeleteTokenCertAndKey(cert, nullptr)) { in DeleteCertAndKeyImpl()
668 if (SEC_DeletePermCertificate(cert)) { in DeleteCertAndKeyImpl()
678 NSSCertDatabase::DeleteCertAndKeyImplScoped(ScopedCERTCertificate cert) { in DeleteCertAndKeyImplScoped() argument
679 return NSSCertDatabase::DeleteCertAndKeyImpl(cert.get()); in DeleteCertAndKeyImplScoped()