Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(466)

Side by Side Diff: net/ssl/client_cert_identity_test_util.h

Issue 2898573002: Refactor client cert private key handling. (Closed)
Patch Set: rebase on https://codereview.chromium.org/2899083006/ Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/ssl/client_cert_identity_mac.cc ('k') | net/ssl/client_cert_identity_test_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 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 NET_SSL_SSL_CLIENT_CERT_IDENTITY_TEST_UTIL_H_
6 #define NET_SSL_SSL_CLIENT_CERT_IDENTITY_TEST_UTIL_H_
7
8 #include "net/ssl/client_cert_identity.h"
9
10 namespace net {
11
12 // Simple ClientCertIdentity implementation for testing.
13 // Note: this implementation of AcquirePrivateKey will always call the callback
14 // synchronously.
15 class FakeClientCertIdentity : public ClientCertIdentity {
16 public:
17 explicit FakeClientCertIdentity(scoped_refptr<X509Certificate> cert);
18 FakeClientCertIdentity(scoped_refptr<X509Certificate> cert,
19 scoped_refptr<SSLPrivateKey> key);
20 ~FakeClientCertIdentity() override;
21
22 // ClientCertIdentity implementation:
23 void AcquirePrivateKey(
24 const base::Callback<void(scoped_refptr<SSLPrivateKey>)>&
25 private_key_callback) override;
26 #if defined(OS_MACOSX)
27 SecIdentityRef sec_identity_ref() const override;
28 #endif
29
30 private:
31 scoped_refptr<SSLPrivateKey> key_;
32 };
33
34 ClientCertIdentityList FakeClientCertIdentityListFromCertificateList(
35 const CertificateList& certs);
36
37 } // namespace net
38
39 #endif // NET_SSL_SSL_CLIENT_CERT_IDENTITY_TEST_UTIL_H_
OLDNEW
« no previous file with comments | « net/ssl/client_cert_identity_mac.cc ('k') | net/ssl/client_cert_identity_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698