OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 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_QUIC_CRYPTO_CRYPTO_SERVER_CONFIG_PROTOBUF_H_ | 5 #ifndef NET_QUIC_CRYPTO_CRYPTO_SERVER_CONFIG_PROTOBUF_H_ |
6 #define NET_QUIC_CRYPTO_CRYPTO_SERVER_CONFIG_PROTOBUF_H_ | 6 #define NET_QUIC_CRYPTO_CRYPTO_SERVER_CONFIG_PROTOBUF_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/strings/string_piece.h" | 12 #include "base/strings/string_piece.h" |
13 #include "net/quic/crypto/crypto_protocol.h" | 13 #include "net/quic/crypto/crypto_protocol.h" |
14 | 14 |
15 namespace net { | 15 namespace net { |
16 | 16 |
17 // TODO(rch): sync with server more rationally. | 17 // TODO(rch): sync with server more rationally. |
18 class QuicServerConfigProtobuf { | 18 class QuicServerConfigProtobuf { |
19 public: | 19 public: |
20 class PrivateKey { | 20 class PrivateKey { |
21 public: | 21 public: |
22 CryptoTag tag() const { | 22 QuicTag tag() const { |
23 return tag_; | 23 return tag_; |
24 } | 24 } |
25 void set_tag(CryptoTag tag) { | 25 void set_tag(QuicTag tag) { |
26 tag_ = tag; | 26 tag_ = tag; |
27 } | 27 } |
28 std::string private_key() const { | 28 std::string private_key() const { |
29 return private_key_; | 29 return private_key_; |
30 } | 30 } |
31 void set_private_key(std::string key) { | 31 void set_private_key(std::string key) { |
32 private_key_ = key; | 32 private_key_ = key; |
33 } | 33 } |
34 | 34 |
35 private: | 35 private: |
36 CryptoTag tag_; | 36 QuicTag tag_; |
37 std::string private_key_; | 37 std::string private_key_; |
38 }; | 38 }; |
39 | 39 |
40 QuicServerConfigProtobuf(); | 40 QuicServerConfigProtobuf(); |
41 ~QuicServerConfigProtobuf(); | 41 ~QuicServerConfigProtobuf(); |
42 | 42 |
43 size_t key_size() const { | 43 size_t key_size() const { |
44 return keys_.size(); | 44 return keys_.size(); |
45 } | 45 } |
46 | 46 |
(...skipping 16 matching lines...) Expand all Loading... |
63 } | 63 } |
64 | 64 |
65 private: | 65 private: |
66 std::vector<PrivateKey*> keys_; | 66 std::vector<PrivateKey*> keys_; |
67 std::string config_; | 67 std::string config_; |
68 }; | 68 }; |
69 | 69 |
70 } // namespace net | 70 } // namespace net |
71 | 71 |
72 #endif // NET_QUIC_CRYPTO_CRYPTO_SERVER_CONFIG_PROTOBUF_H_ | 72 #endif // NET_QUIC_CRYPTO_CRYPTO_SERVER_CONFIG_PROTOBUF_H_ |
OLD | NEW |