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

Side by Side Diff: base/crypto/rsa_private_key_openssl.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 <openssl/evp.h> 7 #include <openssl/evp.h>
8 #include <openssl/pkcs12.h> 8 #include <openssl/pkcs12.h>
9 #include <openssl/rsa.h> 9 #include <openssl/rsa.h>
10 10
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/memory/scoped_ptr.h"
12 #include "base/openssl_util.h" 13 #include "base/openssl_util.h"
13 #include "base/scoped_ptr.h"
14 #include "base/stl_util-inl.h" 14 #include "base/stl_util-inl.h"
15 15
16 namespace base { 16 namespace base {
17 17
18 namespace { 18 namespace {
19 19
20 // Function pointer definition, for injecting the required key export function 20 // Function pointer definition, for injecting the required key export function
21 // into ExportKey, below. The supplied function should export EVP_PKEY into 21 // into ExportKey, below. The supplied function should export EVP_PKEY into
22 // the supplied BIO, returning 1 on success or 0 on failure. 22 // the supplied BIO, returning 1 on success or 0 on failure.
23 typedef int (ExportFunction)(BIO*, EVP_PKEY*); 23 typedef int (ExportFunction)(BIO*, EVP_PKEY*);
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 126
127 bool RSAPrivateKey::ExportPrivateKey(std::vector<uint8>* output) { 127 bool RSAPrivateKey::ExportPrivateKey(std::vector<uint8>* output) {
128 return ExportKey(key_, i2d_PKCS8PrivateKeyInfo_bio, output); 128 return ExportKey(key_, i2d_PKCS8PrivateKeyInfo_bio, output);
129 } 129 }
130 130
131 bool RSAPrivateKey::ExportPublicKey(std::vector<uint8>* output) { 131 bool RSAPrivateKey::ExportPublicKey(std::vector<uint8>* output) {
132 return ExportKey(key_, i2d_PUBKEY_bio, output); 132 return ExportKey(key_, i2d_PUBKEY_bio, output);
133 } 133 }
134 134
135 } // namespace base 135 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698