OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef NET_QUIC_CRYPTO_PROOF_SOURCE_H_ |
| 6 #define NET_QUIC_CRYPTO_PROOF_SOURCE_H_ |
| 7 |
| 8 #include <string> |
| 9 #include <vector> |
| 10 |
| 11 #include "net/base/net_export.h" |
| 12 |
| 13 namespace net { |
| 14 |
| 15 // ProofSource is an interface by which a QUIC server can obtain certificate |
| 16 // chains and signatures that prove its identity. |
| 17 class NET_EXPORT_PRIVATE ProofSource { |
| 18 public: |
| 19 virtual ~ProofSource() {} |
| 20 |
| 21 // GetProof finds a certificate chain for |hostname|, sets |out_certs| to |
| 22 // point to it (in leaf-first order), calculates a signature of |
| 23 // |server_config| using that chain and puts the result in |out_signature|. |
| 24 // |
| 25 // The signature uses SHA-256 as the hash function and PSS padding when the |
| 26 // key is RSA. |
| 27 // |
| 28 // |out_certs| is a pointer to a pointer, not a pointer to an array. |
| 29 // |
| 30 // The number of certificate chains is expected to be small and fixed thus |
| 31 // the ProofSource retains ownership of the contents of |out_certs|. The |
| 32 // expectation is that they will be cached forever. |
| 33 // |
| 34 // The signature values should be cached because |server_config| will be |
| 35 // somewhat static. However, since they aren't bounded, the ProofSource may |
| 36 // wish to evicit entries from that cache, thus the caller takes ownership of |
| 37 // |*out_signature|. |
| 38 // |
| 39 // This function may be called concurrently. |
| 40 virtual bool GetProof(const std::string& hostname, |
| 41 const std::string& server_config, |
| 42 const std::vector<std::string>** out_certs, |
| 43 std::string* out_signature) = 0; |
| 44 }; |
| 45 |
| 46 } // namespace net |
| 47 |
| 48 #endif // NET_QUIC_CRYPTO_PROOF_SOURCE_H_ |
OLD | NEW |