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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 // |not_imported|. | 155 // |not_imported|. |
156 // Returns false if there is an internal error, otherwise true is returned and | 156 // Returns false if there is an internal error, otherwise true is returned and |
157 // |not_imported| should be checked for any certificates that were not | 157 // |not_imported| should be checked for any certificates that were not |
158 // imported. | 158 // imported. |
159 bool ImportServerCert(const CertificateList& certificates, | 159 bool ImportServerCert(const CertificateList& certificates, |
160 ImportCertFailureList* not_imported); | 160 ImportCertFailureList* not_imported); |
161 | 161 |
162 // Get trust bits for certificate. | 162 // Get trust bits for certificate. |
163 TrustBits GetCertTrust(const X509Certificate* cert, CertType type) const; | 163 TrustBits GetCertTrust(const X509Certificate* cert, CertType type) const; |
164 | 164 |
| 165 // IsUntrusted returns true if |cert| is specifically untrusted. These |
| 166 // certificates are stored in the database for the specific purpose of |
| 167 // rejecting them. |
| 168 bool IsUntrusted(const X509Certificate* cert) const; |
| 169 |
165 // Set trust values for certificate. | 170 // Set trust values for certificate. |
166 // Returns true on success or false on failure. | 171 // Returns true on success or false on failure. |
167 bool SetCertTrust(const X509Certificate* cert, | 172 bool SetCertTrust(const X509Certificate* cert, |
168 CertType type, | 173 CertType type, |
169 TrustBits trust_bits); | 174 TrustBits trust_bits); |
170 | 175 |
171 // Delete certificate and associated private key (if one exists). | 176 // Delete certificate and associated private key (if one exists). |
172 // Returns true on success or false on failure. | 177 // Returns true on success or false on failure. |
173 // |cert| is still valid when this function returns. | 178 // |cert| is still valid when this function returns. |
174 bool DeleteCertAndKey(const X509Certificate* cert); | 179 bool DeleteCertAndKey(const X509Certificate* cert); |
(...skipping 15 matching lines...) Expand all Loading... |
190 // Broadcasts notifications to all registered observers. | 195 // Broadcasts notifications to all registered observers. |
191 static void NotifyObserversOfUserCertAdded(const X509Certificate* cert); | 196 static void NotifyObserversOfUserCertAdded(const X509Certificate* cert); |
192 static void NotifyObserversOfCertTrustChanged(const X509Certificate* cert); | 197 static void NotifyObserversOfCertTrustChanged(const X509Certificate* cert); |
193 | 198 |
194 DISALLOW_COPY_AND_ASSIGN(CertDatabase); | 199 DISALLOW_COPY_AND_ASSIGN(CertDatabase); |
195 }; | 200 }; |
196 | 201 |
197 } // namespace net | 202 } // namespace net |
198 | 203 |
199 #endif // NET_BASE_CERT_DATABASE_H_ | 204 #endif // NET_BASE_CERT_DATABASE_H_ |
OLD | NEW |