| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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_CHANNEL_ID_H_ | 5 #ifndef NET_QUIC_CRYPTO_CHANNEL_ID_H_ |
| 6 #define NET_QUIC_CRYPTO_CHANNEL_ID_H_ | 6 #define NET_QUIC_CRYPTO_CHANNEL_ID_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/strings/string_piece.h" | 10 #include "base/strings/string_piece.h" |
| 11 #include "net/base/net_export.h" | 11 #include "net/base/net_export.h" |
| 12 | 12 |
| 13 namespace net { | 13 namespace net { |
| 14 | 14 |
| 15 // ChannelIDSigner is an abstract interface that implements signing by | 15 // ChannelIDSigner is an abstract interface that implements signing by |
| 16 // ChannelID keys. | 16 // ChannelID keys. |
| 17 class NET_EXPORT_PRIVATE ChannelIDSigner { | 17 class NET_EXPORT_PRIVATE ChannelIDSigner { |
| 18 public: | 18 public: |
| 19 virtual ~ChannelIDSigner() { } | 19 virtual ~ChannelIDSigner() {} |
| 20 | 20 |
| 21 // Sign signs |signed_data| using the ChannelID key for |hostname| and puts | 21 // Sign signs |signed_data| using the ChannelID key for |hostname| and puts |
| 22 // the serialized public key into |out_key| and the signature into | 22 // the serialized public key into |out_key| and the signature into |
| 23 // |out_signature|. It returns true on success. | 23 // |out_signature|. It returns true on success. |
| 24 virtual bool Sign(const std::string& hostname, | 24 virtual bool Sign(const std::string& hostname, |
| 25 base::StringPiece signed_data, | 25 base::StringPiece signed_data, |
| 26 std::string* out_key, | 26 std::string* out_key, |
| 27 std::string* out_signature) = 0; | 27 std::string* out_signature) = 0; |
| 28 | 28 |
| 29 // GetKeyForHostname returns the ChannelID key that |ChannelIDSigner| will use | 29 // GetKeyForHostname returns the ChannelID key that |ChannelIDSigner| will use |
| (...skipping 28 matching lines...) Expand all Loading... |
| 58 base::StringPiece signature, | 58 base::StringPiece signature, |
| 59 bool is_channel_id_signature); | 59 bool is_channel_id_signature); |
| 60 | 60 |
| 61 private: | 61 private: |
| 62 DISALLOW_COPY_AND_ASSIGN(ChannelIDVerifier); | 62 DISALLOW_COPY_AND_ASSIGN(ChannelIDVerifier); |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 } // namespace net | 65 } // namespace net |
| 66 | 66 |
| 67 #endif // NET_QUIC_CRYPTO_CHANNEL_ID_H_ | 67 #endif // NET_QUIC_CRYPTO_CHANNEL_ID_H_ |
| OLD | NEW |