Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / net / quic / crypto / proof_source_chromium.h
blobef5e6768c3419891d59126ac6808716e11349654
1 // Copyright 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.
5 #ifndef NET_QUIC_CRYPTO_PROOF_SOURCE_CHROMIUM_H_
6 #define NET_QUIC_CRYPTO_PROOF_SOURCE_CHROMIUM_H_
8 #include <string>
9 #include <vector>
11 #include "base/basictypes.h"
12 #include "base/compiler_specific.h"
13 #include "base/files/file_util.h"
14 #include "crypto/rsa_private_key.h"
15 #include "net/base/net_export.h"
16 #include "net/cert/x509_certificate.h"
17 #include "net/quic/crypto/proof_source.h"
19 namespace net {
21 // ProofSourceChromium implements the QUIC ProofSource interface.
22 // TODO(rtenneti): implement details of this class.
23 class NET_EXPORT_PRIVATE ProofSourceChromium : public ProofSource {
24 public:
25 ProofSourceChromium();
26 ~ProofSourceChromium() override;
28 // Initializes this object based on the certificate chain in |cert_path|,
29 // and the PKCS#8 RSA private key in |key_path|.
30 bool Initialize(const base::FilePath& cert_path,
31 const base::FilePath& key_path);
33 // ProofSource interface
34 bool GetProof(const IPAddressNumber& server_ip,
35 const std::string& hostname,
36 const std::string& server_config,
37 bool ecdsa_ok,
38 const std::vector<std::string>** out_certs,
39 std::string* out_signature) override;
41 private:
42 scoped_ptr<crypto::RSAPrivateKey> private_key_;
43 std::vector<std::string> certificates_;
45 DISALLOW_COPY_AND_ASSIGN(ProofSourceChromium);
48 } // namespace net
50 #endif // NET_QUIC_CRYPTO_PROOF_SOURCE_CHROMIUM_H_