Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / chromeos / dbus / fake_easy_unlock_client.h
blob4f56b786dd039aa11d3629ba221ae44bfd4029af
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 CHROMEOS_DBUS_FAKE_EASY_UNLOCK_CLIENT_H_
6 #define CHROMEOS_DBUS_FAKE_EASY_UNLOCK_CLIENT_H_
8 #include <string>
10 #include "chromeos/dbus/easy_unlock_client.h"
12 namespace chromeos {
14 // A fake implemetation of EasyUnlockClient.
15 class CHROMEOS_EXPORT FakeEasyUnlockClient : public EasyUnlockClient {
16 public:
17 // Tests if the provided keys belong to the same (fake) EC P256 key pair
18 // generated by |this|.
19 static bool IsEcP256KeyPair(const std::string& private_key,
20 const std::string& public_key);
22 FakeEasyUnlockClient();
23 ~FakeEasyUnlockClient() override;
25 // EasyUnlockClient overrides
26 void Init(dbus::Bus* bus) override;
27 void GenerateEcP256KeyPair(const KeyPairCallback& callback) override;
28 void WrapPublicKey(const std::string& key_algorithm,
29 const std::string& public_key,
30 const DataCallback& callback) override;
31 void PerformECDHKeyAgreement(const std::string& private_key,
32 const std::string& public_key,
33 const DataCallback& callback) override;
34 void CreateSecureMessage(const std::string& payload,
35 const CreateSecureMessageOptions& options,
36 const DataCallback& callback) override;
37 void UnwrapSecureMessage(const std::string& message,
38 const UnwrapSecureMessageOptions& options,
39 const DataCallback& callback) override;
41 private:
42 int generated_keys_count_;
44 DISALLOW_COPY_AND_ASSIGN(FakeEasyUnlockClient);
47 } // namespace chromeos
49 #endif // CHROMEOS_DBUS_FAKE_EASY_UNLOCK_CLIENT_H_