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

Side by Side Diff: components/proximity_auth/cryptauth/cryptauth_enroller.h

Issue 2502343003: Moved //components/proximity_auth/cryptauth to //components/cryptauth. (Closed)
Patch Set: Fixed proto #includes. Created 4 years, 1 month 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
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_PROXIMITY_AUTH_CRYPTAUTH_ENROLLER_H
6 #define COMPONENTS_PROXIMITY_AUTH_CRYPTAUTH_ENROLLER_H
7
8 #include <memory>
9 #include <string>
10
11 #include "base/callback_forward.h"
12 #include "components/proximity_auth/cryptauth/proto/cryptauth_api.pb.h"
13
14 namespace proximity_auth {
15
16 // Interface for enrolling a device with CryptAuth.
17 class CryptAuthEnroller {
18 public:
19 virtual ~CryptAuthEnroller() {}
20
21 // Enrolls the device:
22 // |user_public_key|: The user's persistent public key identifying the device.
23 // |user_private_key|: The corresponding private key to |user_public_key|.
24 // |device_info|: Contains information about the local device. Note that the
25 // enroller may change fields in this proto before it is finally uploaded.
26 // |invocation_reason|: The reason why the enrollment occurred.
27 // |callback|: Called will be called with true if the enrollment
28 // succeeds and false otherwise.
29 typedef base::Callback<void(bool)> EnrollmentFinishedCallback;
30 virtual void Enroll(const std::string& user_public_key,
31 const std::string& user_private_key,
32 const cryptauth::GcmDeviceInfo& device_info,
33 cryptauth::InvocationReason invocation_reason,
34 const EnrollmentFinishedCallback& callback) = 0;
35 };
36
37 // Interface for creating CryptAuthEnroller instances.
38 class CryptAuthEnrollerFactory {
39 public:
40 virtual ~CryptAuthEnrollerFactory() {}
41
42 virtual std::unique_ptr<CryptAuthEnroller> CreateInstance() = 0;
43 };
44
45 } // namespace proximity_auth
46
47 #endif // COMPONENTS_PROXIMITY_AUTH_CRYPTAUTH_ENROLLER_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698