| Index: base/crypto/rsa_private_key.cc
|
| diff --git a/base/crypto/rsa_private_key.cc b/base/crypto/rsa_private_key.cc
|
| index 2ab0c142f52ce0a06c6596b7832fdd4bc8a725ca..5730e2768f784ce7e220422c7180378c8da1db64 100644
|
| --- a/base/crypto/rsa_private_key.cc
|
| +++ b/base/crypto/rsa_private_key.cc
|
| @@ -120,6 +120,23 @@ bool PrivateKeyInfoCodec::ExportPublicKeyInfo(std::vector<uint8>* output) {
|
| return true;
|
| }
|
|
|
| +bool PrivateKeyInfoCodec::ExportPublicKey(std::vector<uint8>* output) {
|
| + // Create a sequence with the modulus (n) and public exponent (e).
|
| + std::list<uint8> content;
|
| + PrependInteger(&public_exponent_[0],
|
| + static_cast<int>(public_exponent_.size()),
|
| + &content);
|
| + PrependInteger(&modulus_[0], static_cast<int>(modulus_.size()), &content);
|
| + PrependTypeHeaderAndLength(kSequenceTag, content.size(), &content);
|
| +
|
| + // Copy everything into the output.
|
| + output->reserve(content.size());
|
| + for (std::list<uint8>::iterator i = content.begin(); i != content.end(); ++i)
|
| + output->push_back(*i);
|
| +
|
| + return true;
|
| +}
|
| +
|
| bool PrivateKeyInfoCodec::Import(const std::vector<uint8>& input) {
|
| if (input.empty()) {
|
| return false;
|
|
|