OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_PROXIMITY_AUTH_WIRE_MESSAGE_H | 5 #ifndef COMPONENTS_CRYPTAUTH_WIRE_MESSAGE_H |
6 #define COMPONENTS_PROXIMITY_AUTH_WIRE_MESSAGE_H | 6 #define COMPONENTS_CRYPTAUTH_WIRE_MESSAGE_H |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 | 12 |
13 namespace proximity_auth { | 13 namespace cryptauth { |
14 | 14 |
15 class WireMessage { | 15 class WireMessage { |
16 public: | 16 public: |
17 // Creates a WireMessage containing |payload|. | 17 // Creates a WireMessage containing |payload|. |
18 explicit WireMessage(const std::string& payload); | 18 explicit WireMessage(const std::string& payload); |
19 | 19 |
20 // Creates a WireMessage containing |payload| and |permit_id| in the metadata. | 20 // Creates a WireMessage containing |payload| and |permit_id| in the metadata. |
21 WireMessage(const std::string& payload, const std::string& permit_id); | 21 WireMessage(const std::string& payload, const std::string& permit_id); |
22 | 22 |
23 virtual ~WireMessage(); | 23 virtual ~WireMessage(); |
(...skipping 19 matching lines...) Expand all Loading... |
43 // Identifier of the permit being used. A permit contains the credentials used | 43 // Identifier of the permit being used. A permit contains the credentials used |
44 // to authenticate a device. For example, when sending a WireMessage to the | 44 // to authenticate a device. For example, when sending a WireMessage to the |
45 // remote device the |permit_id_| indexes a permit possibly containing the | 45 // remote device the |permit_id_| indexes a permit possibly containing the |
46 // public key | 46 // public key |
47 // of the local device or a symmetric key shared between the devices. | 47 // of the local device or a symmetric key shared between the devices. |
48 const std::string permit_id_; | 48 const std::string permit_id_; |
49 | 49 |
50 DISALLOW_COPY_AND_ASSIGN(WireMessage); | 50 DISALLOW_COPY_AND_ASSIGN(WireMessage); |
51 }; | 51 }; |
52 | 52 |
53 } // namespace proximity_auth | 53 } // namespace cryptauth |
54 | 54 |
55 #endif // COMPONENTS_PROXIMITY_AUTH_WIRE_MESSAGE_H | 55 #endif // COMPONENTS_CRYPTAUTH_WIRE_MESSAGE_H |
OLD | NEW |