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_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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
214 | 214 |
215 // Creates a copy of the object. | 215 // Creates a copy of the object. |
216 RSAPrivateKey* Copy() const; | 216 RSAPrivateKey* Copy() const; |
217 | 217 |
218 // Exports the private key to a PKCS #1 PrivateKey block. | 218 // Exports the private key to a PKCS #1 PrivateKey block. |
219 bool ExportPrivateKey(std::vector<uint8>* output) const; | 219 bool ExportPrivateKey(std::vector<uint8>* output) const; |
220 | 220 |
221 // Exports the public key to an X509 SubjectPublicKeyInfo block. | 221 // Exports the public key to an X509 SubjectPublicKeyInfo block. |
222 bool ExportPublicKey(std::vector<uint8>* output) const; | 222 bool ExportPublicKey(std::vector<uint8>* output) const; |
223 | 223 |
224 // Signs the message |digest| using this private key as specified in | |
225 // PKCS #1. Assumes the digest was created using SHA1 algorithm. | |
226 bool SignDigest(const std::vector<uint8>& digest, | |
227 std::vector<uint8>* output) const; | |
Ryan Sleevi
2013/07/08 18:09:37
This shouldn't really hang off RSAPrivateKey.
We'
pfeldman
2013/07/08 20:42:50
Done.
| |
228 | |
224 private: | 229 private: |
225 #if defined(USE_NSS) | 230 #if defined(USE_NSS) |
226 FRIEND_TEST_ALL_PREFIXES(RSAPrivateKeyNSSTest, FindFromPublicKey); | 231 FRIEND_TEST_ALL_PREFIXES(RSAPrivateKeyNSSTest, FindFromPublicKey); |
227 FRIEND_TEST_ALL_PREFIXES(RSAPrivateKeyNSSTest, FailedFindFromPublicKey); | 232 FRIEND_TEST_ALL_PREFIXES(RSAPrivateKeyNSSTest, FailedFindFromPublicKey); |
228 #endif | 233 #endif |
229 | 234 |
230 // Constructor is private. Use one of the Create*() or Find*() | 235 // Constructor is private. Use one of the Create*() or Find*() |
231 // methods above instead. | 236 // methods above instead. |
232 RSAPrivateKey(); | 237 RSAPrivateKey(); |
233 | 238 |
(...skipping 19 matching lines...) Expand all Loading... | |
253 SECKEYPrivateKey* key_; | 258 SECKEYPrivateKey* key_; |
254 SECKEYPublicKey* public_key_; | 259 SECKEYPublicKey* public_key_; |
255 #endif | 260 #endif |
256 | 261 |
257 DISALLOW_COPY_AND_ASSIGN(RSAPrivateKey); | 262 DISALLOW_COPY_AND_ASSIGN(RSAPrivateKey); |
258 }; | 263 }; |
259 | 264 |
260 } // namespace crypto | 265 } // namespace crypto |
261 | 266 |
262 #endif // CRYPTO_RSA_PRIVATE_KEY_H_ | 267 #endif // CRYPTO_RSA_PRIVATE_KEY_H_ |
OLD | NEW |