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

Side by Side Diff: crypto/rsa_private_key.h

Issue 559623002: Allow a crypto::RSAPrivateKey object to be wrapped round a pre-existing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « no previous file | crypto/rsa_private_key_nss_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 7
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 9
10 #include <list> 10 #include <list>
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 209
210 // Import an existing public key, and then search for the private 210 // Import an existing public key, and then search for the private
211 // half in the slot specified by |slot|. The format of the public 211 // half in the slot specified by |slot|. The format of the public
212 // key blob is is an X509 SubjectPublicKeyInfo block. This can return 212 // key blob is is an X509 SubjectPublicKeyInfo block. This can return
213 // NULL if initialization fails or the private key cannot be found. 213 // NULL if initialization fails or the private key cannot be found.
214 // The caller takes ownership of the returned object, but nothing new 214 // The caller takes ownership of the returned object, but nothing new
215 // is created in the slot. 215 // is created in the slot.
216 static RSAPrivateKey* FindFromPublicKeyInfoInSlot( 216 static RSAPrivateKey* FindFromPublicKeyInfoInSlot(
217 const std::vector<uint8>& input, 217 const std::vector<uint8>& input,
218 PK11SlotInfo* slot); 218 PK11SlotInfo* slot);
219 #elif defined(USE_OPENSSL)
220 // Create a new instance by referencing an existing private key
221 // structure. Does not import the key.
davidben 2014/09/09 18:28:57 Nit: What does "Does not import the key" mean in t
dougsteed 2014/09/09 21:05:47 Done.
222 static RSAPrivateKey* CreateFromKey(EVP_PKEY* key);
223
219 #endif 224 #endif
220 225
221 #if defined(USE_OPENSSL) 226 #if defined(USE_OPENSSL)
222 EVP_PKEY* key() { return key_; } 227 EVP_PKEY* key() { return key_; }
223 #else 228 #else
224 SECKEYPrivateKey* key() { return key_; } 229 SECKEYPrivateKey* key() { return key_; }
225 SECKEYPublicKey* public_key() { return public_key_; } 230 SECKEYPublicKey* public_key() { return public_key_; }
226 #endif 231 #endif
227 232
228 // Creates a copy of the object. 233 // Creates a copy of the object.
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 SECKEYPrivateKey* key_; 283 SECKEYPrivateKey* key_;
279 SECKEYPublicKey* public_key_; 284 SECKEYPublicKey* public_key_;
280 #endif 285 #endif
281 286
282 DISALLOW_COPY_AND_ASSIGN(RSAPrivateKey); 287 DISALLOW_COPY_AND_ASSIGN(RSAPrivateKey);
283 }; 288 };
284 289
285 } // namespace crypto 290 } // namespace crypto
286 291
287 #endif // CRYPTO_RSA_PRIVATE_KEY_H_ 292 #endif // CRYPTO_RSA_PRIVATE_KEY_H_
OLDNEW
« no previous file with comments | « no previous file | crypto/rsa_private_key_nss_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698