Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Unified Diff: remoting/host/host_key_pair.cc

Issue 6805019: Move crypto files out of base, to a top level directory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Fixes comments by eroman Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/host_key_pair.h ('k') | remoting/host/keygen_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/host_key_pair.cc
===================================================================
--- remoting/host/host_key_pair.cc (revision 81350)
+++ remoting/host/host_key_pair.cc (working copy)
@@ -9,12 +9,12 @@
#include <vector>
#include "base/base64.h"
-#include "base/crypto/rsa_private_key.h"
-#include "base/crypto/signature_creator.h"
#include "base/logging.h"
#include "base/rand_util.h"
#include "base/task.h"
#include "base/time.h"
+#include "crypto/rsa_private_key.h"
+#include "crypto/signature_creator.h"
#include "net/base/x509_certificate.h"
#include "remoting/host/host_config.h"
@@ -25,7 +25,7 @@
HostKeyPair::~HostKeyPair() { }
void HostKeyPair::Generate() {
- key_.reset(base::RSAPrivateKey::Create(2048));
+ key_.reset(crypto::RSAPrivateKey::Create(2048));
}
bool HostKeyPair::LoadFromString(const std::string& key_base64) {
@@ -36,7 +36,7 @@
}
std::vector<uint8> key_buf(key_str.begin(), key_str.end());
- key_.reset(base::RSAPrivateKey::CreateFromPrivateKeyInfo(key_buf));
+ key_.reset(crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(key_buf));
if (key_.get() == NULL) {
LOG(ERROR) << "Invalid private key.";
return false;
@@ -76,8 +76,8 @@
}
std::string HostKeyPair::GetSignature(const std::string& message) const {
- scoped_ptr<base::SignatureCreator> signature_creator(
- base::SignatureCreator::Create(key_.get()));
+ scoped_ptr<crypto::SignatureCreator> signature_creator(
+ crypto::SignatureCreator::Create(key_.get()));
signature_creator->Update(reinterpret_cast<const uint8*>(message.c_str()),
message.length());
std::vector<uint8> signature_buf;
@@ -88,10 +88,10 @@
return signature_base64;
}
-base::RSAPrivateKey* HostKeyPair::CopyPrivateKey() const {
+crypto::RSAPrivateKey* HostKeyPair::CopyPrivateKey() const {
std::vector<uint8> key_bytes;
CHECK(key_->ExportPrivateKey(&key_bytes));
- return base::RSAPrivateKey::CreateFromPrivateKeyInfo(key_bytes);
+ return crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(key_bytes);
}
net::X509Certificate* HostKeyPair::GenerateCertificate() const {
« no previous file with comments | « remoting/host/host_key_pair.h ('k') | remoting/host/keygen_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698