OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 | 7 |
8 #include "net/base/x509_certificate.h" | 8 #include "base/basictypes.h" |
9 | 9 |
10 namespace net { | 10 namespace net { |
11 | 11 |
| 12 class X509Certificate; |
| 13 |
12 // This class provides functions to manipulate the local | 14 // This class provides functions to manipulate the local |
13 // certificate store. | 15 // certificate store. |
14 | 16 |
15 // TODO(gauravsh): This class could be augmented with methods | 17 // TODO(gauravsh): This class could be augmented with methods |
16 // for all operations that manipulate the underlying system | 18 // for all operations that manipulate the underlying system |
17 // certificate store. | 19 // certificate store. |
18 | 20 |
19 class CertDatabase { | 21 class CertDatabase { |
20 public: | 22 public: |
21 CertDatabase(); | 23 CertDatabase(); |
22 | 24 |
23 // Check whether this is a valid user cert that we have the private key for. | 25 // Check whether this is a valid user cert that we have the private key for. |
24 // Returns OK or a network error code such as ERR_CERT_CONTAINS_ERRORS. | 26 // Returns OK or a network error code such as ERR_CERT_CONTAINS_ERRORS. |
25 int CheckUserCert(X509Certificate* cert); | 27 int CheckUserCert(X509Certificate* cert); |
26 | 28 |
27 // Store user (client) certificate. Assumes CheckUserCert has already passed. | 29 // Store user (client) certificate. Assumes CheckUserCert has already passed. |
28 // Returns OK, or ERR_ADD_USER_CERT_FAILED if there was a problem saving to | 30 // Returns OK, or ERR_ADD_USER_CERT_FAILED if there was a problem saving to |
29 // the platform cert database, or possibly other network error codes. | 31 // the platform cert database, or possibly other network error codes. |
30 int AddUserCert(X509Certificate* cert); | 32 int AddUserCert(X509Certificate* cert); |
31 | 33 |
32 private: | 34 private: |
33 void Init(); | |
34 DISALLOW_COPY_AND_ASSIGN(CertDatabase); | 35 DISALLOW_COPY_AND_ASSIGN(CertDatabase); |
35 }; | 36 }; |
36 | 37 |
37 } // namespace net | 38 } // namespace net |
38 | 39 |
39 #endif // NET_BASE_CERT_DATABASE_H_ | 40 #endif // NET_BASE_CERT_DATABASE_H_ |
OLD | NEW |