OLD | NEW |
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 #ifndef BASE_CRYPTO_RSA_PRIVATE_KEY_H_ | 5 #ifndef BASE_CRYPTO_RSA_PRIVATE_KEY_H_ |
6 #define BASE_CRYPTO_RSA_PRIVATE_KEY_H_ | 6 #define BASE_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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 // initialization fails or the private key cannot be found. The | 197 // initialization fails or the private key cannot be found. The |
198 // caller takes ownership of the returned object, but nothing new is | 198 // caller takes ownership of the returned object, but nothing new is |
199 // created in the key database. | 199 // created in the key database. |
200 // | 200 // |
201 // NOTE: Currently only available if USE_NSS is defined. | 201 // NOTE: Currently only available if USE_NSS is defined. |
202 static RSAPrivateKey* FindFromPublicKeyInfo( | 202 static RSAPrivateKey* FindFromPublicKeyInfo( |
203 const std::vector<uint8>& input); | 203 const std::vector<uint8>& input); |
204 | 204 |
205 ~RSAPrivateKey(); | 205 ~RSAPrivateKey(); |
206 | 206 |
207 #if defined(USE_NSS) | 207 #if defined(USE_OPENSSL) |
| 208 EVP_PKEY* key() { return key_; } |
| 209 #elif defined(USE_NSS) |
208 SECKEYPrivateKeyStr* key() { return key_; } | 210 SECKEYPrivateKeyStr* key() { return key_; } |
209 #elif defined(OS_WIN) | 211 #elif defined(OS_WIN) |
210 HCRYPTPROV provider() { return provider_; } | 212 HCRYPTPROV provider() { return provider_; } |
211 HCRYPTKEY key() { return key_; } | 213 HCRYPTKEY key() { return key_; } |
212 #elif defined(OS_MACOSX) | 214 #elif defined(OS_MACOSX) |
213 CSSM_KEY_PTR key() { return &key_; } | 215 CSSM_KEY_PTR key() { return &key_; } |
214 #endif | 216 #endif |
215 | 217 |
216 // Exports the private key to a PKCS #1 PrivateKey block. | 218 // Exports the private key to a PKCS #1 PrivateKey block. |
217 bool ExportPrivateKey(std::vector<uint8>* output); | 219 bool ExportPrivateKey(std::vector<uint8>* output); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 #elif defined(OS_MACOSX) | 256 #elif defined(OS_MACOSX) |
255 CSSM_KEY key_; | 257 CSSM_KEY key_; |
256 #endif | 258 #endif |
257 | 259 |
258 DISALLOW_COPY_AND_ASSIGN(RSAPrivateKey); | 260 DISALLOW_COPY_AND_ASSIGN(RSAPrivateKey); |
259 }; | 261 }; |
260 | 262 |
261 } // namespace base | 263 } // namespace base |
262 | 264 |
263 #endif // BASE_CRYPTO_RSA_PRIVATE_KEY_H_ | 265 #endif // BASE_CRYPTO_RSA_PRIVATE_KEY_H_ |
OLD | NEW |