Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Unified Diff: net/quic/crypto/channel_id.h

Issue 300223007: Break ChannelIDSigner into two classes: ChannelIDKey and ChannelIDSource. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes build on C++03 Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/quic/crypto/channel_id_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/crypto/channel_id.h
diff --git a/net/quic/crypto/channel_id.h b/net/quic/crypto/channel_id.h
index a560f152c6d542b85d736898fcd28c675b9a9ff1..76442f60f43a0edabb27a831798e3ba083dbdda9 100644
--- a/net/quic/crypto/channel_id.h
+++ b/net/quic/crypto/channel_id.h
@@ -7,28 +7,37 @@
#include <string>
+#include "base/memory/scoped_ptr.h"
#include "base/strings/string_piece.h"
#include "net/base/net_export.h"
namespace net {
-// ChannelIDSigner is an abstract interface that implements signing by
-// ChannelID keys.
-class NET_EXPORT_PRIVATE ChannelIDSigner {
+// ChannelIDKey is an interface that supports signing with and serializing a
+// ChannelID key.
+class NET_EXPORT_PRIVATE ChannelIDKey {
public:
- virtual ~ChannelIDSigner() { }
+ virtual ~ChannelIDKey() { }
- // Sign signs |signed_data| using the ChannelID key for |hostname| and puts
- // the serialized public key into |out_key| and the signature into
- // |out_signature|. It returns true on success.
- virtual bool Sign(const std::string& hostname,
- base::StringPiece signed_data,
- std::string* out_key,
+ // Sign signs |signed_data| using the ChannelID private key and puts the
+ // signature into |out_signature|. It returns true on success.
+ virtual bool Sign(base::StringPiece signed_data,
std::string* out_signature) = 0;
- // GetKeyForHostname returns the ChannelID key that |ChannelIDSigner| will use
- // for the given hostname.
- virtual std::string GetKeyForHostname(const std::string& hostname) = 0;
+ // SerializeKey returns the serialized ChannelID public key.
+ virtual std::string SerializeKey() = 0;
+};
+
+// ChannelIDSource is an abstract interface by which a QUIC client can obtain
+// a ChannelIDKey for a given hostname.
+class NET_EXPORT_PRIVATE ChannelIDSource {
+ public:
+ virtual ~ChannelIDSource() {}
+
+ // GetChannelIDKey looks up the ChannelIDKey for |hostname|. On success it
+ // returns true and stores the ChannelIDKey in |*channel_id|.
+ virtual bool GetChannelIDKey(const std::string& hostname,
+ scoped_ptr<ChannelIDKey>* channel_id_key) = 0;
};
// ChannelIDVerifier verifies ChannelID signatures.
« no previous file with comments | « no previous file | net/quic/crypto/channel_id_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698