| OLD | NEW |
| 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_EC_PRIVATE_KEY_H_ | 5 #ifndef CRYPTO_EC_PRIVATE_KEY_H_ |
| 6 #define CRYPTO_EC_PRIVATE_KEY_H_ | 6 #define CRYPTO_EC_PRIVATE_KEY_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 static bool ImportFromEncryptedPrivateKeyInfo( | 59 static bool ImportFromEncryptedPrivateKeyInfo( |
| 60 PK11SlotInfo* slot, | 60 PK11SlotInfo* slot, |
| 61 const std::string& password, | 61 const std::string& password, |
| 62 const uint8* encrypted_private_key_info, | 62 const uint8* encrypted_private_key_info, |
| 63 size_t encrypted_private_key_info_len, | 63 size_t encrypted_private_key_info_len, |
| 64 CERTSubjectPublicKeyInfo* decoded_spki, | 64 CERTSubjectPublicKeyInfo* decoded_spki, |
| 65 bool permanent, | 65 bool permanent, |
| 66 bool sensitive, | 66 bool sensitive, |
| 67 SECKEYPrivateKey** key, | 67 SECKEYPrivateKey** key, |
| 68 SECKEYPublicKey** public_key); | 68 SECKEYPublicKey** public_key); |
| 69 #endif |
| 69 | 70 |
| 70 // Returns a copy of the object. | 71 // Returns a copy of the object. |
| 71 ECPrivateKey* Copy() const; | 72 ECPrivateKey* Copy() const; |
| 72 #endif | |
| 73 | 73 |
| 74 #if defined(USE_OPENSSL) | 74 #if defined(USE_OPENSSL) |
| 75 EVP_PKEY* key() { return key_; } | 75 EVP_PKEY* key() { return key_; } |
| 76 #else | 76 #else |
| 77 SECKEYPrivateKey* key() { return key_; } | 77 SECKEYPrivateKey* key() { return key_; } |
| 78 SECKEYPublicKey* public_key() { return public_key_; } | 78 SECKEYPublicKey* public_key() { return public_key_; } |
| 79 #endif | 79 #endif |
| 80 | 80 |
| 81 // Exports the private key as an ASN.1-encoded PKCS #8 EncryptedPrivateKeyInfo | 81 // Exports the private key as an ASN.1-encoded PKCS #8 EncryptedPrivateKeyInfo |
| 82 // block and the public key as an X.509 SubjectPublicKeyInfo block. | 82 // block and the public key as an X.509 SubjectPublicKeyInfo block. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 109 SECKEYPublicKey* public_key_; | 109 SECKEYPublicKey* public_key_; |
| 110 #endif | 110 #endif |
| 111 | 111 |
| 112 DISALLOW_COPY_AND_ASSIGN(ECPrivateKey); | 112 DISALLOW_COPY_AND_ASSIGN(ECPrivateKey); |
| 113 }; | 113 }; |
| 114 | 114 |
| 115 | 115 |
| 116 } // namespace crypto | 116 } // namespace crypto |
| 117 | 117 |
| 118 #endif // CRYPTO_EC_PRIVATE_KEY_H_ | 118 #endif // CRYPTO_EC_PRIVATE_KEY_H_ |
| OLD | NEW |