| 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/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/strings/string_piece.h" | 11 #include "base/strings/string_piece.h" |
| 12 #include "net/base/net_export.h" | 12 #include "net/base/net_export.h" |
| 13 #include "net/quic/quic_types.h" | 13 #include "net/quic/quic_types.h" |
| 14 | 14 |
| 15 namespace net { | 15 namespace net { |
| 16 | 16 |
| 17 // ChannelIDKey is an interface that supports signing with and serializing a | 17 // ChannelIDKey is an interface that supports signing with and serializing a |
| 18 // ChannelID key. | 18 // ChannelID key. |
| 19 class NET_EXPORT_PRIVATE ChannelIDKey { | 19 class NET_EXPORT_PRIVATE ChannelIDKey { |
| 20 public: | 20 public: |
| 21 virtual ~ChannelIDKey() { } | 21 virtual ~ChannelIDKey() {} |
| 22 | 22 |
| 23 // Sign signs |signed_data| using the ChannelID private key and puts the | 23 // Sign signs |signed_data| using the ChannelID private key and puts the |
| 24 // signature into |out_signature|. It returns true on success. | 24 // signature into |out_signature|. It returns true on success. |
| 25 virtual bool Sign(base::StringPiece signed_data, | 25 virtual bool Sign(base::StringPiece signed_data, |
| 26 std::string* out_signature) const = 0; | 26 std::string* out_signature) const = 0; |
| 27 | 27 |
| 28 // SerializeKey returns the serialized ChannelID public key. | 28 // SerializeKey returns the serialized ChannelID public key. |
| 29 virtual std::string SerializeKey() const = 0; | 29 virtual std::string SerializeKey() const = 0; |
| 30 }; | 30 }; |
| 31 | 31 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 base::StringPiece signature, | 89 base::StringPiece signature, |
| 90 bool is_channel_id_signature); | 90 bool is_channel_id_signature); |
| 91 | 91 |
| 92 private: | 92 private: |
| 93 DISALLOW_COPY_AND_ASSIGN(ChannelIDVerifier); | 93 DISALLOW_COPY_AND_ASSIGN(ChannelIDVerifier); |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 } // namespace net | 96 } // namespace net |
| 97 | 97 |
| 98 #endif // NET_QUIC_CRYPTO_CHANNEL_ID_H_ | 98 #endif // NET_QUIC_CRYPTO_CHANNEL_ID_H_ |
| OLD | NEW |