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

Side by Side Diff: components/cryptauth/remote_device.h

Issue 2897843002: Revert of [EasyUnlock] Add beacon_seeds to RemoteDevice. (Closed)
Patch Set: Created 3 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 unified diff | Download patch
OLDNEW
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_CRYPTAUTH_REMOTE_DEVICE_H_ 5 #ifndef COMPONENTS_CRYPTAUTH_REMOTE_DEVICE_H_
6 #define COMPONENTS_CRYPTAUTH_REMOTE_DEVICE_H_ 6 #define COMPONENTS_CRYPTAUTH_REMOTE_DEVICE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "components/cryptauth/proto/cryptauth_api.pb.h"
12
13 namespace cryptauth { 11 namespace cryptauth {
14 12
15 struct RemoteDevice { 13 struct RemoteDevice {
16 public: 14 public:
17 std::string user_id; 15 std::string user_id;
18 std::string name; 16 std::string name;
19 std::string public_key; 17 std::string public_key;
20 std::string bluetooth_address; 18 std::string bluetooth_address;
21 std::string persistent_symmetric_key; 19 std::string persistent_symmetric_key;
22 std::string sign_in_challenge; 20 std::string sign_in_challenge;
23 21
24 // Note: To save space, the BeaconSeeds may not necessarily be included in
25 // this object.
26 bool are_beacon_seeds_loaded;
27 std::vector<BeaconSeed> beacon_seeds;
28
29 RemoteDevice(); 22 RemoteDevice();
30 RemoteDevice(const std::string& user_id, 23 RemoteDevice(const std::string& user_id,
31 const std::string& name, 24 const std::string& name,
32 const std::string& public_key, 25 const std::string& public_key,
33 const std::string& bluetooth_address, 26 const std::string& bluetooth_address,
34 const std::string& persistent_symmetric_key, 27 const std::string& persistent_symmetric_key,
35 std::string sign_in_challenge); 28 std::string sign_in_challenge);
36 RemoteDevice(const RemoteDevice& other); 29 RemoteDevice(const RemoteDevice& other);
37 ~RemoteDevice(); 30 ~RemoteDevice();
38 31
39 // Loads a vector of BeaconSeeds for the RemoteDevice.
40 void LoadBeaconSeeds(const std::vector<BeaconSeed>& beacon_seeds);
41
42 // Returns a unique ID for the device. 32 // Returns a unique ID for the device.
43 std::string GetDeviceId() const; 33 std::string GetDeviceId() const;
44 34
45 // Returns a shortened device ID for the purpose of concise logging (device 35 // Returns a shortened device ID for the purpose of concise logging (device
46 // IDs are often so long that logs are difficult to read). Note that this 36 // IDs are often so long that logs are difficult to read). Note that this
47 // ID is not guaranteed to be unique, so it should only be used for log. 37 // ID is not guaranteed to be unique, so it should only be used for log.
48 std::string GetTruncatedDeviceIdForLogs() const; 38 std::string GetTruncatedDeviceIdForLogs() const;
49 39
50 bool operator==(const RemoteDevice& other) const; 40 bool operator==(const RemoteDevice& other) const;
51 41
52 // Compares devices via their public keys. Note that this function is 42 // Compares devices via their public keys. Note that this function is
53 // necessary in order to use |RemoteDevice| as a key of a std::map. 43 // necessary in order to use |RemoteDevice| as a key of a std::map.
54 bool operator<(const RemoteDevice& other) const; 44 bool operator<(const RemoteDevice& other) const;
55 45
56 // Static method for truncated device ID for logs. 46 // Static method for truncated device ID for logs.
57 static std::string TruncateDeviceIdForLogs(const std::string& full_id); 47 static std::string TruncateDeviceIdForLogs(const std::string& full_id);
58 }; 48 };
59 49
60 typedef std::vector<RemoteDevice> RemoteDeviceList; 50 typedef std::vector<RemoteDevice> RemoteDeviceList;
61 51
62 } // namespace cryptauth 52 } // namespace cryptauth
63 53
64 #endif // COMPONENTS_CRYPTAUTH_REMOTE_DEVICE_H_ 54 #endif // COMPONENTS_CRYPTAUTH_REMOTE_DEVICE_H_
OLDNEW
« no previous file with comments | « chromeos/components/tether/tether_host_fetcher_unittest.cc ('k') | components/cryptauth/remote_device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698