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

Side by Side Diff: net/ssl/client_cert_identity_mac.cc

Issue 2898573002: Refactor client cert private key handling. (Closed)
Patch Set: removed no longer needed forward declaration 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.h ('k') | net/ssl/client_cert_identity_test_util.h » ('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 #include "net/ssl/client_cert_identity_mac.h"
6
7 #include "net/ssl/ssl_platform_key_mac.h"
8 #include "net/ssl/ssl_private_key.h"
9
10 namespace net {
11
12 ClientCertIdentityMac::ClientCertIdentityMac(
13 scoped_refptr<net::X509Certificate> cert,
14 base::ScopedCFTypeRef<SecIdentityRef> sec_identity)
15 : ClientCertIdentity(std::move(cert)), identity_(std::move(sec_identity)) {}
16
17 ClientCertIdentityMac::~ClientCertIdentityMac() = default;
18
19 void ClientCertIdentityMac::AcquirePrivateKey(
20 const base::Callback<void(scoped_refptr<SSLPrivateKey>)>&
21 private_key_callback) {
22 // This only adds a ref to and returns the private key from identity_ so it
23 // doesn't need to run on a worker thread.
24 private_key_callback.Run(
25 CreateSSLPrivateKeyForSecIdentity(certificate(), identity_.get()));
26 }
27
28 SecIdentityRef ClientCertIdentityMac::sec_identity_ref() const {
29 return identity_.get();
30 }
31
32 } // namespace net
OLDNEW
« no previous file with comments | « net/ssl/client_cert_identity_mac.h ('k') | net/ssl/client_cert_identity_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698