| OLD | NEW |
| (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_ |
| OLD | NEW |