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

Side by Side Diff: chrome/browser/certificate_manager_model.cc

Issue 5686002: NSS: PKCS 11 password prompt. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressing review comments Created 9 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/certificate_manager_model.h" 5 #include "chrome/browser/certificate_manager_model.h"
6 6
7 #include "base/i18n/time_formatting.h" 7 #include "base/i18n/time_formatting.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/common/net/x509_certificate_model.h" 10 #include "chrome/common/net/x509_certificate_model.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 case COL_EXPIRES_ON: 67 case COL_EXPIRES_ON:
68 if (!cert.valid_expiry().is_null()) 68 if (!cert.valid_expiry().is_null())
69 rv = base::TimeFormatShortDateNumeric(cert.valid_expiry()); 69 rv = base::TimeFormatShortDateNumeric(cert.valid_expiry());
70 break; 70 break;
71 default: 71 default:
72 NOTREACHED(); 72 NOTREACHED();
73 } 73 }
74 return rv; 74 return rv;
75 } 75 }
76 76
77 int CertificateManagerModel::ImportFromPKCS12(const std::string& data, 77 int CertificateManagerModel::ImportFromPKCS12(net::CryptoModule* module,
78 const std::string& data,
78 const string16& password) { 79 const string16& password) {
79 int result = cert_db_.ImportFromPKCS12(data, password); 80 int result = cert_db_.ImportFromPKCS12(module, data, password);
80 if (result == net::OK) 81 if (result == net::OK)
81 Refresh(); 82 Refresh();
82 return result; 83 return result;
83 } 84 }
84 85
85 bool CertificateManagerModel::ImportCACerts( 86 bool CertificateManagerModel::ImportCACerts(
86 const net::CertificateList& certificates, 87 const net::CertificateList& certificates,
87 unsigned int trust_bits, 88 unsigned int trust_bits,
88 net::CertDatabase::ImportCertFailureList* not_imported) { 89 net::CertDatabase::ImportCertFailureList* not_imported) {
89 bool result = cert_db_.ImportCACerts(certificates, trust_bits, not_imported); 90 bool result = cert_db_.ImportCACerts(certificates, trust_bits, not_imported);
(...skipping 16 matching lines...) Expand all
106 unsigned int trust_bits) { 107 unsigned int trust_bits) {
107 return cert_db_.SetCertTrust(cert, type, trust_bits); 108 return cert_db_.SetCertTrust(cert, type, trust_bits);
108 } 109 }
109 110
110 bool CertificateManagerModel::Delete(net::X509Certificate* cert) { 111 bool CertificateManagerModel::Delete(net::X509Certificate* cert) {
111 bool result = cert_db_.DeleteCertAndKey(cert); 112 bool result = cert_db_.DeleteCertAndKey(cert);
112 if (result) 113 if (result)
113 Refresh(); 114 Refresh();
114 return result; 115 return result;
115 } 116 }
OLDNEW
« no previous file with comments | « chrome/browser/certificate_manager_model.h ('k') | chrome/browser/dom_ui/options/certificate_manager_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698