OLD | NEW |
---|---|
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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
59 rv = UTF8ToUTF16( | 59 rv = UTF8ToUTF16( |
60 x509_certificate_model::GetTokenName(cert.os_cert_handle())); | 60 x509_certificate_model::GetTokenName(cert.os_cert_handle())); |
61 break; | 61 break; |
62 case COL_SERIAL_NUMBER: | 62 case COL_SERIAL_NUMBER: |
63 rv = ASCIIToUTF16( | 63 rv = ASCIIToUTF16( |
64 x509_certificate_model::GetSerialNumberHexified( | 64 x509_certificate_model::GetSerialNumberHexified( |
65 cert.os_cert_handle(), "")); | 65 cert.os_cert_handle(), "")); |
66 break; | 66 break; |
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 = WideToUTF16Hack( | 69 rv = base::TimeFormatShortDateNumeric(cert.valid_expiry()); |
Evan Martin
2010/12/22 02:45:22
curlies no longer necessary
| |
70 base::TimeFormatShortDateNumeric(cert.valid_expiry())); | |
71 } | 70 } |
72 break; | 71 break; |
73 default: | 72 default: |
74 NOTREACHED(); | 73 NOTREACHED(); |
75 } | 74 } |
76 return rv; | 75 return rv; |
77 } | 76 } |
78 | 77 |
79 int CertificateManagerModel::ImportFromPKCS12(const std::string& data, | 78 int CertificateManagerModel::ImportFromPKCS12(const std::string& data, |
80 const string16& password) { | 79 const string16& password) { |
(...skipping 27 matching lines...) Expand all Loading... | |
108 unsigned int trust_bits) { | 107 unsigned int trust_bits) { |
109 return cert_db_.SetCertTrust(cert, type, trust_bits); | 108 return cert_db_.SetCertTrust(cert, type, trust_bits); |
110 } | 109 } |
111 | 110 |
112 bool CertificateManagerModel::Delete(net::X509Certificate* cert) { | 111 bool CertificateManagerModel::Delete(net::X509Certificate* cert) { |
113 bool result = cert_db_.DeleteCertAndKey(cert); | 112 bool result = cert_db_.DeleteCertAndKey(cert); |
114 if (result) | 113 if (result) |
115 Refresh(); | 114 Refresh(); |
116 return result; | 115 return result; |
117 } | 116 } |
OLD | NEW |