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