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
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_PROXIMITY_AUTH_CLIENT_H
6 #define COMPONENTS_PROXIMITY_AUTH_CLIENT_H
8 namespace proximity_auth
{
12 // A client handling the Easy Unlock protocol, capable of parsing events from
13 // the remote device and sending events for the local device.
18 // Adds or removes an observer for Client events.
19 virtual void AddObserver(ClientObserver
* observer
) = 0;
20 virtual void RemoveObserver(ClientObserver
* observer
) = 0;
22 // Returns true iff the remote device supports the v3.1 sign-in protocol.
23 virtual bool SupportsSignIn() const = 0;
25 // Sends an unlock event message to the remote device.
26 virtual void DispatchUnlockEvent() = 0;
28 // Sends a serialized SecureMessage to the remote device to decrypt the
29 // |challenge|. OnDecryptResponse will be called for each observer when the
30 // decrypted response is received.
31 // TODO(isherman): Add params for the RSA private key and crypto delegate.
32 virtual void RequestDecryption(const std::string
& challenge
) = 0;
34 // Sends a simple request to the remote device to unlock the screen.
35 // OnUnlockResponse is called for each observer when the response is returned.
36 virtual void RequestUnlock() = 0;
39 } // namespace proximity_auth
41 #endif // COMPONENTS_PROXIMITY_AUTH_CLIENT_H