// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef NET_BASE_CERT_DATABASE_H_ #define NET_BASE_CERT_DATABASE_H_ #include "net/base/x509_certificate.h" namespace net { // This class provides functions to manipulate the local // certificate store. // TODO(gauravsh): This class could be augmented with methods // for all operations that manipulate the underlying system // certificate store. class CertDatabase { public: CertDatabase(); // Check whether this is a valid user cert that we have the private key for. // Returns OK or a network error code such as ERR_CERT_CONTAINS_ERRORS. int CheckUserCert(X509Certificate* cert); // Store user (client) certificate. Assumes CheckUserCert has already passed. // Returns OK, or ERR_ADD_USER_CERT_FAILED if there was a problem saving to // the platform cert database, or possibly other network error codes. int AddUserCert(X509Certificate* cert); private: void Init(); DISALLOW_COPY_AND_ASSIGN(CertDatabase); }; } // namespace net #endif // NET_BASE_CERT_DATABASE_H_