Avi Drissman | 4e1b7bc3 | 2022-09-15 14:03:50 | [diff] [blame] | 1 | // Copyright 2018 The Chromium Authors |
Jun Cai | 9409ded | 2018-01-30 00:19:46 | [diff] [blame] | 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 CONTENT_BROWSER_SSL_PRIVATE_KEY_IMPL_H_ |
| 6 | #define CONTENT_BROWSER_SSL_PRIVATE_KEY_IMPL_H_ |
| 7 | |
| 8 | #include <stdint.h> |
| 9 | |
| 10 | #include <vector> |
| 11 | |
Jun Cai | 9409ded | 2018-01-30 00:19:46 | [diff] [blame] | 12 | #include "base/memory/ref_counted.h" |
| 13 | #include "net/base/net_errors.h" |
| 14 | #include "net/ssl/ssl_private_key.h" |
Sigurd Schneider | a3b0258 | 2021-07-27 13:51:37 | [diff] [blame] | 15 | #include "services/network/public/mojom/url_loader_network_service_observer.mojom.h" |
Jun Cai | 9409ded | 2018-01-30 00:19:46 | [diff] [blame] | 16 | |
| 17 | namespace content { |
| 18 | |
| 19 | class SSLPrivateKeyImpl : public network::mojom::SSLPrivateKey { |
| 20 | public: |
| 21 | explicit SSLPrivateKeyImpl(scoped_refptr<net::SSLPrivateKey> ssl_private_key); |
Peter Boström | 828b902 | 2021-09-21 02:28:43 | [diff] [blame] | 22 | |
| 23 | SSLPrivateKeyImpl(const SSLPrivateKeyImpl&) = delete; |
| 24 | SSLPrivateKeyImpl& operator=(const SSLPrivateKeyImpl&) = delete; |
| 25 | |
Jun Cai | 9409ded | 2018-01-30 00:19:46 | [diff] [blame] | 26 | ~SSLPrivateKeyImpl() override; |
| 27 | |
| 28 | // network::mojom::SSLPrivateKey: |
| 29 | void Sign(uint16_t algorithm, |
| 30 | const std::vector<uint8_t>& input, |
| 31 | network::mojom::SSLPrivateKey::SignCallback callback) override; |
| 32 | |
| 33 | private: |
David Benjamin | 168681a | 2025-05-14 21:13:32 | [diff] [blame] | 34 | static void Callback(network::mojom::SSLPrivateKey::SignCallback callback, |
| 35 | net::Error net_error, |
| 36 | const std::vector<uint8_t>& signature); |
Jun Cai | 9409ded | 2018-01-30 00:19:46 | [diff] [blame] | 37 | |
| 38 | scoped_refptr<net::SSLPrivateKey> ssl_private_key_; |
Jun Cai | 9409ded | 2018-01-30 00:19:46 | [diff] [blame] | 39 | }; |
| 40 | |
| 41 | } // namespace content |
| 42 | |
| 43 | #endif // CONTENT_BROWSER_SSL_PRIVATE_KEY_IMPL_H_ |