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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 std::vector<uint8_t>* output); | 88 std::vector<uint8_t>* output); |
89 | 89 |
90 // Exports the public key to an X.509 SubjectPublicKeyInfo block. | 90 // Exports the public key to an X.509 SubjectPublicKeyInfo block. |
91 bool ExportPublicKey(std::vector<uint8_t>* output); | 91 bool ExportPublicKey(std::vector<uint8_t>* output); |
92 | 92 |
93 // Exports the public key as an EC point in the uncompressed point format. | 93 // Exports the public key as an EC point in the uncompressed point format. |
94 bool ExportRawPublicKey(std::string* output); | 94 bool ExportRawPublicKey(std::string* output); |
95 | 95 |
96 // Exports private key data for testing. The format of data stored into output | 96 // Exports private key data for testing. The format of data stored into output |
97 // doesn't matter other than that it is consistent for the same key. | 97 // doesn't matter other than that it is consistent for the same key. |
98 bool ExportValue(std::vector<uint8_t>* output); | 98 bool ExportValueForTesting(std::vector<uint8_t>* output); |
99 bool ExportECParams(std::vector<uint8_t>* output); | |
100 | 99 |
101 private: | 100 private: |
102 // Constructor is private. Use one of the Create*() methods above instead. | 101 // Constructor is private. Use one of the Create*() methods above instead. |
103 ECPrivateKey(); | 102 ECPrivateKey(); |
104 | 103 |
105 #if defined(USE_OPENSSL) | 104 #if defined(USE_OPENSSL) |
106 EVP_PKEY* key_; | 105 EVP_PKEY* key_; |
107 #else | 106 #else |
108 SECKEYPrivateKey* key_; | 107 SECKEYPrivateKey* key_; |
109 SECKEYPublicKey* public_key_; | 108 SECKEYPublicKey* public_key_; |
110 #endif | 109 #endif |
111 | 110 |
112 DISALLOW_COPY_AND_ASSIGN(ECPrivateKey); | 111 DISALLOW_COPY_AND_ASSIGN(ECPrivateKey); |
113 }; | 112 }; |
114 | 113 |
115 | 114 |
116 } // namespace crypto | 115 } // namespace crypto |
117 | 116 |
118 #endif // CRYPTO_EC_PRIVATE_KEY_H_ | 117 #endif // CRYPTO_EC_PRIVATE_KEY_H_ |
OLD | NEW |