• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2016 The Chromium Authors
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 NET_SSL_TEST_SSL_PRIVATE_KEY_H_
6 #define NET_SSL_TEST_SSL_PRIVATE_KEY_H_
7 
8 #include "base/containers/span.h"
9 #include "base/memory/scoped_refptr.h"
10 
11 namespace crypto {
12 class RSAPrivateKey;
13 }
14 
15 namespace net {
16 
17 class SSLPrivateKey;
18 
19 // Returns a new `SSLPrivateKey` which uses `rsa_private_key` for signing
20 // operations or `nullptr` on error.
21 scoped_refptr<SSLPrivateKey> WrapRSAPrivateKey(
22     crypto::RSAPrivateKey* rsa_private_key);
23 
24 // Returns a new `SSLPrivateKey` which fails all signing operations.
25 scoped_refptr<SSLPrivateKey> CreateFailSigningSSLPrivateKey();
26 
27 // Returns a new `SSLPrivateKey` which behaves like `key`, but overrides the
28 // signing preferences.
29 scoped_refptr<SSLPrivateKey> WrapSSLPrivateKeyWithPreferences(
30     scoped_refptr<SSLPrivateKey> key,
31     base::span<const uint16_t> prefs);
32 
33 }  // namespace net
34 
35 #endif  // NET_SSL_TEST_SSL_PRIVATE_KEY_H_
36