15f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// Copyright 2014 The Chromium Authors. All rights reserved.
25f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// found in the LICENSE file.
45f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)
55f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)#ifndef NET_SSL_OPENSSL_PLATFORM_KEY_H_
65f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)#define NET_SSL_OPENSSL_PLATFORM_KEY_H_
75f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)
85f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)#include "crypto/scoped_openssl_types.h"
95f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)
105f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)namespace net {
115f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)
125f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)class X509Certificate;
135f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)
145f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// Looks up the private key from the platform key store corresponding
155f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// to |certificate|'s public key. Then wraps it in an OpenSSL EVP_PKEY
165f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// structure to be used for SSL client auth.
175f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)//
185f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// TODO(davidben): This combines looking up a private key with
195f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// wrapping it in an OpenSSL structure. This will be separated with
205f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// https://crbug.com/394131
215f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)crypto::ScopedEVP_PKEY FetchClientCertPrivateKey(
225f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)    const X509Certificate* certificate);
235f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)
245f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)}  // namespace net
255f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)
265f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)#endif  // NET_SSL_OPENSSL_PLATFORM_KEY_H_
27