Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1632)

Unified Diff: chrome/browser/chromeos/options/cert_library.cc

Issue 182313004: Remove GetPkcs11Id from x509_certificate_model (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: .. Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/options/cert_library.h ('k') | chrome/browser/chromeos/options/vpn_config_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/options/cert_library.cc
diff --git a/chrome/browser/chromeos/options/cert_library.cc b/chrome/browser/chromeos/options/cert_library.cc
index d90518670e527252d4b810e19ad94967693062fd..7eeea75ada20b9cdd2691bda8fbe4564c7a82f16 100644
--- a/chrome/browser/chromeos/options/cert_library.cc
+++ b/chrome/browser/chromeos/options/cert_library.cc
@@ -161,13 +161,13 @@ base::string16 CertLibrary::GetCertDisplayStringAt(CertType type,
return GetDisplayString(cert, hardware_backed);
}
-std::string CertLibrary::GetCertPEMAt(CertType type, int index) const {
- return CertToPEM(*GetCertificateAt(type, index));
+std::string CertLibrary::GetServerCACertPEMAt(int index) const {
+ return CertToPEM(*GetCertificateAt(CERT_TYPE_SERVER_CA, index));
}
-std::string CertLibrary::GetCertPkcs11IdAt(CertType type, int index) const {
- net::X509Certificate* cert = GetCertificateAt(type, index);
- return x509_certificate_model::GetPkcs11Id(cert->os_cert_handle());
+std::string CertLibrary::GetUserCertPkcs11IdAt(int index) const {
+ net::X509Certificate* cert = GetCertificateAt(CERT_TYPE_USER, index);
+ return CertLoader::GetPkcs11IdForCert(*cert);
}
bool CertLibrary::IsCertHardwareBackedAt(CertType type, int index) const {
@@ -175,11 +175,11 @@ bool CertLibrary::IsCertHardwareBackedAt(CertType type, int index) const {
return CertLoader::Get()->IsCertificateHardwareBacked(cert);
}
-int CertLibrary::GetCertIndexByPEM(CertType type,
- const std::string& pem_encoded) const {
- int num_certs = NumCertificates(type);
+int CertLibrary::GetServerCACertIndexByPEM(
+ const std::string& pem_encoded) const {
+ int num_certs = NumCertificates(CERT_TYPE_SERVER_CA);
for (int index = 0; index < num_certs; ++index) {
- net::X509Certificate* cert = GetCertificateAt(type, index);
+ net::X509Certificate* cert = GetCertificateAt(CERT_TYPE_SERVER_CA, index);
if (CertToPEM(*cert) != pem_encoded)
continue;
return index;
@@ -187,13 +187,12 @@ int CertLibrary::GetCertIndexByPEM(CertType type,
return -1;
}
-int CertLibrary::GetCertIndexByPkcs11Id(CertType type,
- const std::string& pkcs11_id) const {
- int num_certs = NumCertificates(type);
+int CertLibrary::GetUserCertIndexByPkcs11Id(
+ const std::string& pkcs11_id) const {
+ int num_certs = NumCertificates(CERT_TYPE_USER);
for (int index = 0; index < num_certs; ++index) {
- net::X509Certificate* cert = GetCertificateAt(type, index);
- net::X509Certificate::OSCertHandle cert_handle = cert->os_cert_handle();
- std::string id = x509_certificate_model::GetPkcs11Id(cert_handle);
+ net::X509Certificate* cert = GetCertificateAt(CERT_TYPE_USER, index);
+ std::string id = CertLoader::GetPkcs11IdForCert(*cert);
if (id == pkcs11_id)
return index;
}
« no previous file with comments | « chrome/browser/chromeos/options/cert_library.h ('k') | chrome/browser/chromeos/options/vpn_config_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698