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_SSL_PLATFORM_KEY_MAC_H_ 6 #define NET_SSL_SSL_PLATFORM_KEY_MAC_H_ 7 8 #include <Security/SecBase.h> 9 10 #include "base/memory/scoped_refptr.h" 11 #include "crypto/unexportable_key.h" 12 #include "net/base/net_export.h" 13 14 namespace net { 15 16 class SSLPrivateKey; 17 class X509Certificate; 18 19 // Returns an `SSLPrivateKey` backed by the platform private key in `key`, which 20 // must correspond to `certificate`'s public key. 21 NET_EXPORT scoped_refptr<SSLPrivateKey> CreateSSLPrivateKeyForSecKey( 22 const X509Certificate* certificate, 23 SecKeyRef key); 24 25 // Returns an `SSLPrivateKey` backed by the platform private key contained in 26 // `unexportable_key`. 27 NET_EXPORT scoped_refptr<SSLPrivateKey> WrapUnexportableKey( 28 const crypto::UnexportableSigningKey& unexportable_key); 29 30 } // namespace net 31 32 #endif // NET_SSL_SSL_PLATFORM_KEY_MAC_H_ 33