blob: b71394f4ffb7db54029764ac4adec965f5c3a182 [file] [log] [blame]
Avi Drissman4e1b7bc32022-09-15 14:03:501// Copyright 2018 The Chromium Authors
Jun Cai9409ded2018-01-30 00:19:462// 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 Cai9409ded2018-01-30 00:19:4612#include "base/memory/ref_counted.h"
13#include "net/base/net_errors.h"
14#include "net/ssl/ssl_private_key.h"
Sigurd Schneidera3b02582021-07-27 13:51:3715#include "services/network/public/mojom/url_loader_network_service_observer.mojom.h"
Jun Cai9409ded2018-01-30 00:19:4616
17namespace content {
18
19class SSLPrivateKeyImpl : public network::mojom::SSLPrivateKey {
20 public:
21 explicit SSLPrivateKeyImpl(scoped_refptr<net::SSLPrivateKey> ssl_private_key);
Peter Boström828b9022021-09-21 02:28:4322
23 SSLPrivateKeyImpl(const SSLPrivateKeyImpl&) = delete;
24 SSLPrivateKeyImpl& operator=(const SSLPrivateKeyImpl&) = delete;
25
Jun Cai9409ded2018-01-30 00:19:4626 ~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 Benjamin168681a2025-05-14 21:13:3234 static void Callback(network::mojom::SSLPrivateKey::SignCallback callback,
35 net::Error net_error,
36 const std::vector<uint8_t>& signature);
Jun Cai9409ded2018-01-30 00:19:4637
38 scoped_refptr<net::SSLPrivateKey> ssl_private_key_;
Jun Cai9409ded2018-01-30 00:19:4639};
40
41} // namespace content
42
43#endif // CONTENT_BROWSER_SSL_PRIVATE_KEY_IMPL_H_