| 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 "net/base/x509_certificate.h" |
| 9 | 9 |
| 10 namespace net { | 10 namespace net { |
| 11 | 11 |
| 12 // This class provides functions to manipulate the local | 12 // This class provides functions to manipulate the local |
| 13 // certificate store. | 13 // certificate store. |
| 14 | 14 |
| 15 // TODO(gauravsh): This class could be augmented with methods | 15 // TODO(gauravsh): This class could be augmented with methods |
| 16 // for all operations that manipulate the underlying system | 16 // for all operations that manipulate the underlying system |
| 17 // certificate store. | 17 // certificate store. |
| 18 | 18 |
| 19 class CertDatabase { | 19 class CertDatabase { |
| 20 public: | 20 public: |
| 21 CertDatabase(); | 21 CertDatabase(); |
| 22 | 22 |
| 23 // Extract and Store User (Client) Certificate from a data blob. | 23 // Check whether this is a valid user cert that we have the private key for. |
| 24 // Return true if successful. | 24 // Returns OK or a network error code such as ERR_CERT_CONTAINS_ERRORS. |
| 25 bool AddUserCert(const char* data, int len); | 25 int CheckUserCert(X509Certificate* cert); |
| 26 |
| 27 // Store user (client) certificate. Assumes CheckUserCert has already passed. |
| 28 // Returns OK or a network error code such as ERR_FAILED. |
| 29 int AddUserCert(X509Certificate* cert); |
| 26 | 30 |
| 27 private: | 31 private: |
| 28 void Init(); | 32 void Init(); |
| 29 DISALLOW_COPY_AND_ASSIGN(CertDatabase); | 33 DISALLOW_COPY_AND_ASSIGN(CertDatabase); |
| 30 }; | 34 }; |
| 31 | 35 |
| 32 } // namespace net | 36 } // namespace net |
| 33 | 37 |
| 34 #endif // NET_BASE_CERT_DATABASE_H_ | 38 #endif // NET_BASE_CERT_DATABASE_H_ |
| OLD | NEW |