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

Side by Side Diff: base/crypto/rsa_private_key_mac.cc

Issue 6714032: Move some files in base to base/memory. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: only base Created 9 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/crypto/rsa_private_key.h" 5 #include "base/crypto/rsa_private_key.h"
6 6
7 #include <list> 7 #include <list>
8 8
9 #include "base/crypto/cssm_init.h" 9 #include "base/crypto/cssm_init.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 12
13 namespace base { 13 namespace base {
14 14
15 // static 15 // static
16 RSAPrivateKey* RSAPrivateKey::Create(uint16 num_bits) { 16 RSAPrivateKey* RSAPrivateKey::Create(uint16 num_bits) {
17 scoped_ptr<RSAPrivateKey> result(new RSAPrivateKey); 17 scoped_ptr<RSAPrivateKey> result(new RSAPrivateKey);
18 18
19 CSSM_CC_HANDLE cc_handle; 19 CSSM_CC_HANDLE cc_handle;
20 CSSM_RETURN crtn; 20 CSSM_RETURN crtn;
21 crtn = CSSM_CSP_CreateKeyGenContext(GetSharedCSPHandle(), CSSM_ALGID_RSA, 21 crtn = CSSM_CSP_CreateKeyGenContext(GetSharedCSPHandle(), CSSM_ALGID_RSA,
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 bool RSAPrivateKey::ExportPublicKey(std::vector<uint8>* output) { 187 bool RSAPrivateKey::ExportPublicKey(std::vector<uint8>* output) {
188 PrivateKeyInfoCodec private_key_info(true); 188 PrivateKeyInfoCodec private_key_info(true);
189 std::vector<uint8> private_key_data; 189 std::vector<uint8> private_key_data;
190 private_key_data.assign(key_.KeyData.Data, 190 private_key_data.assign(key_.KeyData.Data,
191 key_.KeyData.Data + key_.KeyData.Length); 191 key_.KeyData.Data + key_.KeyData.Length);
192 return (private_key_info.Import(private_key_data) && 192 return (private_key_info.Import(private_key_data) &&
193 private_key_info.ExportPublicKeyInfo(output)); 193 private_key_info.ExportPublicKeyInfo(output));
194 } 194 }
195 195
196 } // namespace base 196 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698