OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef NET_BASE_CERT_DATABASE_H_ | 5 #ifndef NET_BASE_CERT_DATABASE_H_ |
6 #define NET_BASE_CERT_DATABASE_H_ | 6 #define NET_BASE_CERT_DATABASE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 // |not_imported|. | 149 // |not_imported|. |
150 // Returns false if there is an internal error, otherwise true is returned and | 150 // Returns false if there is an internal error, otherwise true is returned and |
151 // |not_imported| should be checked for any certificates that were not | 151 // |not_imported| should be checked for any certificates that were not |
152 // imported. | 152 // imported. |
153 bool ImportServerCert(const CertificateList& certificates, | 153 bool ImportServerCert(const CertificateList& certificates, |
154 ImportCertFailureList* not_imported); | 154 ImportCertFailureList* not_imported); |
155 | 155 |
156 // Get trust bits for certificate. | 156 // Get trust bits for certificate. |
157 unsigned int GetCertTrust(const X509Certificate* cert, CertType type) const; | 157 unsigned int GetCertTrust(const X509Certificate* cert, CertType type) const; |
158 | 158 |
| 159 // IsUntrusted returns true if |cert| is specifically untrusted. These |
| 160 // certificates are remembered for the specific purpose of rejecting them. |
| 161 bool IsUntrusted(const X509Certificate* cert) const; |
| 162 |
159 // Set trust values for certificate. | 163 // Set trust values for certificate. |
160 // Returns true on success or false on failure. | 164 // Returns true on success or false on failure. |
161 bool SetCertTrust(const X509Certificate* cert, | 165 bool SetCertTrust(const X509Certificate* cert, |
162 CertType type, | 166 CertType type, |
163 unsigned int trust_bits); | 167 unsigned int trust_bits); |
164 | 168 |
165 // Delete certificate and associated private key (if one exists). | 169 // Delete certificate and associated private key (if one exists). |
166 // Returns true on success or false on failure. | 170 // Returns true on success or false on failure. |
167 // |cert| is still valid when this function returns. | 171 // |cert| is still valid when this function returns. |
168 bool DeleteCertAndKey(const X509Certificate* cert); | 172 bool DeleteCertAndKey(const X509Certificate* cert); |
(...skipping 15 matching lines...) Expand all Loading... |
184 // Broadcasts notifications to all registered observers. | 188 // Broadcasts notifications to all registered observers. |
185 static void NotifyObserversOfUserCertAdded(const X509Certificate* cert); | 189 static void NotifyObserversOfUserCertAdded(const X509Certificate* cert); |
186 static void NotifyObserversOfCertTrustChanged(const X509Certificate* cert); | 190 static void NotifyObserversOfCertTrustChanged(const X509Certificate* cert); |
187 | 191 |
188 DISALLOW_COPY_AND_ASSIGN(CertDatabase); | 192 DISALLOW_COPY_AND_ASSIGN(CertDatabase); |
189 }; | 193 }; |
190 | 194 |
191 } // namespace net | 195 } // namespace net |
192 | 196 |
193 #endif // NET_BASE_CERT_DATABASE_H_ | 197 #endif // NET_BASE_CERT_DATABASE_H_ |
OLD | NEW |