| Index: crypto/rsa_private_key_nss_unittest.cc
|
| diff --git a/crypto/rsa_private_key_nss_unittest.cc b/crypto/rsa_private_key_nss_unittest.cc
|
| index 0ec801d26d1d45b3c8e2c68b28b64734ad569f8b..59c641d2ce61763f5fa9cce14b7ab4ff99746755 100644
|
| --- a/crypto/rsa_private_key_nss_unittest.cc
|
| +++ b/crypto/rsa_private_key_nss_unittest.cc
|
| @@ -25,9 +25,33 @@ class RSAPrivateKeyNSSTest : public testing::Test {
|
| }
|
|
|
| private:
|
| + ScopedTestNSSDB test_nssdb_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(RSAPrivateKeyNSSTest);
|
| };
|
|
|
| +TEST_F(RSAPrivateKeyNSSTest, CreateFromKeypairTest) {
|
| + scoped_ptr<crypto::RSAPrivateKey> key_pair(RSAPrivateKey::Create(256));
|
| +
|
| + scoped_ptr<crypto::RSAPrivateKey> key_copy(
|
| + RSAPrivateKey::CreateFromKeypair(key_pair->key(),
|
| + key_pair->public_key()));
|
| + ASSERT_TRUE(key_copy.get());
|
| +
|
| + std::vector<uint8> privkey;
|
| + std::vector<uint8> pubkey;
|
| + ASSERT_TRUE(key_pair->ExportPrivateKey(&privkey));
|
| + ASSERT_TRUE(key_pair->ExportPublicKey(&pubkey));
|
| +
|
| + std::vector<uint8> privkey_copy;
|
| + std::vector<uint8> pubkey_copy;
|
| + ASSERT_TRUE(key_copy->ExportPrivateKey(&privkey_copy));
|
| + ASSERT_TRUE(key_copy->ExportPublicKey(&pubkey_copy));
|
| +
|
| + ASSERT_EQ(privkey, privkey_copy);
|
| + ASSERT_EQ(pubkey, pubkey_copy);
|
| +}
|
| +
|
| TEST_F(RSAPrivateKeyNSSTest, FindFromPublicKey) {
|
| // Create a keypair, which will put the keys in the user's NSSDB.
|
| scoped_ptr<crypto::RSAPrivateKey> key_pair(RSAPrivateKey::Create(256));
|
|
|