| OLD | NEW |
| (Empty) |
| 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. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_NETWORKING_PRIVATE_CRYPTO_VERIFY_IMPL_H_ | |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_NETWORKING_PRIVATE_CRYPTO_VERIFY_IMPL_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "base/memory/ref_counted.h" | |
| 10 #include "extensions/browser/api/networking_private/networking_private_delegate.
h" | |
| 11 | |
| 12 namespace base { | |
| 13 class SequencedTaskRunner; | |
| 14 } | |
| 15 | |
| 16 namespace extensions { | |
| 17 | |
| 18 // Implementation of NetworkingPrivateDelegate::VerifyDelegate using | |
| 19 // networking_private_crypto. | |
| 20 class CryptoVerifyImpl : public NetworkingPrivateDelegate::VerifyDelegate { | |
| 21 public: | |
| 22 CryptoVerifyImpl(); | |
| 23 ~CryptoVerifyImpl() override; | |
| 24 | |
| 25 struct Credentials { | |
| 26 // VerificationProperties are not copyable so define a struct that can be | |
| 27 // passed to tasks on the worker thread. | |
| 28 explicit Credentials(const VerificationProperties& properties); | |
| 29 Credentials(const Credentials& other); | |
| 30 ~Credentials(); | |
| 31 | |
| 32 std::string certificate; | |
| 33 std::vector<std::string> intermediate_certificates; | |
| 34 std::string signed_data; | |
| 35 std::string unsigned_data; | |
| 36 std::string device_bssid; | |
| 37 std::string public_key; | |
| 38 }; | |
| 39 | |
| 40 // NetworkingPrivateDelegate::VerifyDelegate | |
| 41 void VerifyDestination(const VerificationProperties& verification_properties, | |
| 42 const BoolCallback& success_callback, | |
| 43 const FailureCallback& failure_callback) override; | |
| 44 void VerifyAndEncryptCredentials( | |
| 45 const std::string& guid, | |
| 46 const VerificationProperties& verification_properties, | |
| 47 const StringCallback& success_callback, | |
| 48 const FailureCallback& failure_callback) override; | |
| 49 void VerifyAndEncryptData( | |
| 50 const VerificationProperties& verification_properties, | |
| 51 const std::string& data, | |
| 52 const StringCallback& success_callback, | |
| 53 const FailureCallback& failure_callback) override; | |
| 54 | |
| 55 private: | |
| 56 // Task runner for blocking tasks. | |
| 57 scoped_refptr<base::SequencedTaskRunner> blocking_pool_task_runner_; | |
| 58 | |
| 59 DISALLOW_COPY_AND_ASSIGN(CryptoVerifyImpl); | |
| 60 }; | |
| 61 | |
| 62 } // namespace extensions | |
| 63 | |
| 64 #endif // CHROME_BROWSER_EXTENSIONS_API_NETWORKING_PRIVATE_CRYPTO_VERIFY_IMPL_H
_ | |
| OLD | NEW |