Chromium Code Reviews| Index: net/base/origin_bound_cert_store.h |
| =================================================================== |
| --- net/base/origin_bound_cert_store.h (revision 96316) |
| +++ net/base/origin_bound_cert_store.h (working copy) |
| @@ -7,6 +7,7 @@ |
| #pragma once |
| #include <string> |
| +#include <vector> |
| #include "net/base/net_api.h" |
| @@ -21,6 +22,12 @@ |
| class NET_API OriginBoundCertStore { |
| public: |
| + struct OriginBoundCertInfo { |
|
wtc
2011/08/16 23:28:57
Should we mention this is used by GetAllOriginBoun
|
| + std::string origin; // Origin, for instance "https://www.versign.com:8443". |
|
wtc
2011/08/16 23:28:57
Nit: "versign" is misspelled. Use a typical HTTPS
|
| + std::string private_key; // DER-encoded PrivateKeyInfo struct. |
| + std::string cert; // DER-encoded certificate. |
| + }; |
| + |
| virtual ~OriginBoundCertStore() {} |
| // TODO(rkn): Specify certificate type (RSA or DSA). |
| @@ -34,11 +41,23 @@ |
| std::string* private_key_result, |
| std::string* cert_result) = 0; |
| - // Adds an origin bound cert to the store. |
| - virtual bool SetOriginBoundCert(const std::string& origin, |
| + // Adds an origin bound cert and the corresponding private key to the store. |
| + virtual void SetOriginBoundCert(const std::string& origin, |
| const std::string& private_key, |
| const std::string& cert) = 0; |
| + // Removes an origin bound cert and the corresponding private key from the |
| + // store. |
| + virtual void DeleteOriginBoundCert(const std::string& origin) = 0; |
| + |
| + // Removes all origin bound certs and the corresponding private keys from |
| + // the store. |
| + virtual void DeleteAll() = 0; |
| + |
| + // Returns all origin bound certs and the corresponding private keys. |
| + virtual void GetAllOriginBoundCerts( |
| + std::vector<OriginBoundCertInfo>* origin_bound_certs) = 0; |
| + |
| // Returns the number of certs in the store. |
| // Public only for unit testing. |
| virtual int GetCertCount() = 0; |