| Index: net/ssl/client_cert_identity_test_util.h
|
| diff --git a/net/ssl/client_cert_identity_test_util.h b/net/ssl/client_cert_identity_test_util.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..e73cf56535a835bcca4f15ad5383439136c087ce
|
| --- /dev/null
|
| +++ b/net/ssl/client_cert_identity_test_util.h
|
| @@ -0,0 +1,39 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef NET_SSL_SSL_CLIENT_CERT_IDENTITY_TEST_UTIL_H_
|
| +#define NET_SSL_SSL_CLIENT_CERT_IDENTITY_TEST_UTIL_H_
|
| +
|
| +#include "net/ssl/client_cert_identity.h"
|
| +
|
| +namespace net {
|
| +
|
| +// Simple ClientCertIdentity implementation for testing.
|
| +// Note: this implementation of AcquirePrivateKey will always call the callback
|
| +// synchronously.
|
| +class FakeClientCertIdentity : public ClientCertIdentity {
|
| + public:
|
| + explicit FakeClientCertIdentity(scoped_refptr<X509Certificate> cert);
|
| + FakeClientCertIdentity(scoped_refptr<X509Certificate> cert,
|
| + scoped_refptr<SSLPrivateKey> key);
|
| + ~FakeClientCertIdentity() override;
|
| +
|
| + // ClientCertIdentity implementation:
|
| + void AcquirePrivateKey(
|
| + const base::Callback<void(scoped_refptr<SSLPrivateKey>)>&
|
| + private_key_callback) override;
|
| +#if defined(OS_MACOSX)
|
| + SecIdentityRef sec_identity_ref() const override;
|
| +#endif
|
| +
|
| + private:
|
| + scoped_refptr<SSLPrivateKey> key_;
|
| +};
|
| +
|
| +ClientCertIdentityList FakeClientCertIdentityListFromCertificateList(
|
| + const CertificateList& certs);
|
| +
|
| +} // namespace net
|
| +
|
| +#endif // NET_SSL_SSL_CLIENT_CERT_IDENTITY_TEST_UTIL_H_
|
|
|