OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 DEVICE_U2F_U2F_DEVICE_H_ | 5 #ifndef DEVICE_U2F_U2F_DEVICE_H_ |
6 #define DEVICE_U2F_U2F_DEVICE_H_ | 6 #define DEVICE_U2F_U2F_DEVICE_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 | 32 |
33 using MessageCallback = | 33 using MessageCallback = |
34 base::Callback<void(ReturnCode, std::vector<uint8_t>)>; | 34 base::Callback<void(ReturnCode, std::vector<uint8_t>)>; |
35 using VersionCallback = | 35 using VersionCallback = |
36 base::Callback<void(bool success, ProtocolVersion version)>; | 36 base::Callback<void(bool success, ProtocolVersion version)>; |
37 using DeviceCallback = | 37 using DeviceCallback = |
38 base::Callback<void(bool success, | 38 base::Callback<void(bool success, |
39 std::unique_ptr<U2fApduResponse> response)>; | 39 std::unique_ptr<U2fApduResponse> response)>; |
40 using WinkCallback = base::Callback<void()>; | 40 using WinkCallback = base::Callback<void()>; |
41 | 41 |
42 ~U2fDevice(); | 42 virtual ~U2fDevice(); |
43 | 43 |
44 // Raw messages parameters are defined by the specification at | 44 // Raw messages parameters are defined by the specification at |
45 // https://fidoalliance.org/specs/fido-u2f-v1.0-nfc-bt-amendment-20150514/fido
-u2f-raw-message-formats.html | 45 // https://fidoalliance.org/specs/fido-u2f-v1.0-nfc-bt-amendment-20150514/fido
-u2f-raw-message-formats.html |
46 void Register(const std::vector<uint8_t>& appid_digest, | 46 void Register(const std::vector<uint8_t>& appid_digest, |
47 const std::vector<uint8_t>& challenge_digest, | 47 const std::vector<uint8_t>& challenge_digest, |
48 const MessageCallback& callback); | 48 const MessageCallback& callback); |
49 void Version(const VersionCallback& callback); | 49 void Version(const VersionCallback& callback); |
50 void Sign(const std::vector<uint8_t>& appid_digest, | 50 void Sign(const std::vector<uint8_t>& appid_digest, |
51 const std::vector<uint8_t>& challenge_digest, | 51 const std::vector<uint8_t>& challenge_digest, |
52 const std::vector<uint8_t>& key_handle, | 52 const std::vector<uint8_t>& key_handle, |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 std::unique_ptr<U2fApduResponse> response); | 88 std::unique_ptr<U2fApduResponse> response); |
89 | 89 |
90 base::WeakPtrFactory<U2fDevice> weak_factory_; | 90 base::WeakPtrFactory<U2fDevice> weak_factory_; |
91 | 91 |
92 DISALLOW_COPY_AND_ASSIGN(U2fDevice); | 92 DISALLOW_COPY_AND_ASSIGN(U2fDevice); |
93 }; | 93 }; |
94 | 94 |
95 } // namespace device | 95 } // namespace device |
96 | 96 |
97 #endif // DEVICE_U2F_U2F_DEVICE_H_ | 97 #endif // DEVICE_U2F_U2F_DEVICE_H_ |
OLD | NEW |