summaryrefslogtreecommitdiffstats
path: root/net/curvecp/connection_key.h
blob: cf092a341a180aae569f9b2ad95eafaae3e0d166 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef NET_CURVECP_CONNECTION_KEY_H_
#define NET_CURVECP_CONNECTION_KEY_H_

#include <string>

namespace net {

// A ConnectionKey uniquely identifies a connection.
// It represents the client's short-term public key and is 32 bytes.
class ConnectionKey {
 public:
  ConnectionKey();
  ConnectionKey(unsigned char bytes[]);
  ConnectionKey(const ConnectionKey& key);

  ConnectionKey& operator=(const ConnectionKey& other);
  bool operator==(const ConnectionKey& other) const;
  bool operator<(const ConnectionKey& other) const;

  std::string ToString() const;

 private:
  unsigned char key_[32];
};

}  // namespace net

#endif  // NET_CURVECP_CONNECTION_KEY_H_