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

Side by Side Diff: crypto/rsa_private_key.h

Issue 8727014: Implement RSAPrivateKey::Copy() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years 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
« no previous file with comments | « no previous file | crypto/rsa_private_key_mac.cc » ('j') | crypto/rsa_private_key_mac.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef CRYPTO_RSA_PRIVATE_KEY_H_ 5 #ifndef CRYPTO_RSA_PRIVATE_KEY_H_
6 #define CRYPTO_RSA_PRIVATE_KEY_H_ 6 #define CRYPTO_RSA_PRIVATE_KEY_H_
7 #pragma once 7 #pragma once
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 10
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 SECKEYPrivateKeyStr* key() { return key_; } 216 SECKEYPrivateKeyStr* key() { return key_; }
217 SECKEYPublicKeyStr* public_key() { return public_key_; } 217 SECKEYPublicKeyStr* public_key() { return public_key_; }
218 #elif defined(OS_WIN) 218 #elif defined(OS_WIN)
219 HCRYPTPROV provider() { return provider_; } 219 HCRYPTPROV provider() { return provider_; }
220 HCRYPTKEY key() { return key_; } 220 HCRYPTKEY key() { return key_; }
221 #elif defined(OS_MACOSX) 221 #elif defined(OS_MACOSX)
222 CSSM_KEY_PTR key() { return &key_; } 222 CSSM_KEY_PTR key() { return &key_; }
223 CSSM_KEY_PTR public_key() { return &public_key_; } 223 CSSM_KEY_PTR public_key() { return &public_key_; }
224 #endif 224 #endif
225 225
226 // Creates a copy of the object.
227 RSAPrivateKey* Copy() const;
228
226 // Exports the private key to a PKCS #1 PrivateKey block. 229 // Exports the private key to a PKCS #1 PrivateKey block.
227 bool ExportPrivateKey(std::vector<uint8>* output); 230 bool ExportPrivateKey(std::vector<uint8>* output);
228 231
229 // Exports the public key to an X509 SubjectPublicKeyInfo block. 232 // Exports the public key to an X509 SubjectPublicKeyInfo block.
230 bool ExportPublicKey(std::vector<uint8>* output); 233 bool ExportPublicKey(std::vector<uint8>* output);
231 234
232 private: 235 private:
233 #if defined(USE_NSS) 236 #if defined(USE_NSS)
234 FRIEND_TEST_ALL_PREFIXES(RSAPrivateKeyNSSTest, FindFromPublicKey); 237 FRIEND_TEST_ALL_PREFIXES(RSAPrivateKeyNSSTest, FindFromPublicKey);
235 FRIEND_TEST_ALL_PREFIXES(RSAPrivateKeyNSSTest, FailedFindFromPublicKey); 238 FRIEND_TEST_ALL_PREFIXES(RSAPrivateKeyNSSTest, FailedFindFromPublicKey);
(...skipping 29 matching lines...) Expand all
265 CSSM_KEY key_; 268 CSSM_KEY key_;
266 CSSM_KEY public_key_; 269 CSSM_KEY public_key_;
267 #endif 270 #endif
268 271
269 DISALLOW_COPY_AND_ASSIGN(RSAPrivateKey); 272 DISALLOW_COPY_AND_ASSIGN(RSAPrivateKey);
270 }; 273 };
271 274
272 } // namespace crypto 275 } // namespace crypto
273 276
274 #endif // CRYPTO_RSA_PRIVATE_KEY_H_ 277 #endif // CRYPTO_RSA_PRIVATE_KEY_H_
OLDNEW
« no previous file with comments | « no previous file | crypto/rsa_private_key_mac.cc » ('j') | crypto/rsa_private_key_mac.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698