summaryrefslogtreecommitdiffstats
path: root/base/crypto
diff options
context:
space:
mode:
Diffstat (limited to 'base/crypto')
-rw-r--r--base/crypto/encryptor_openssl.cc32
-rw-r--r--base/crypto/rsa_private_key_openssl.cc79
-rw-r--r--base/crypto/signature_creator_openssl.cc32
-rw-r--r--base/crypto/signature_verifier_openssl.cc41
-rw-r--r--base/crypto/symmetric_key.h5
-rw-r--r--base/crypto/symmetric_key_openssl.cc43
6 files changed, 231 insertions, 1 deletions
diff --git a/base/crypto/encryptor_openssl.cc b/base/crypto/encryptor_openssl.cc
new file mode 100644
index 0000000..71a84be
--- /dev/null
+++ b/base/crypto/encryptor_openssl.cc
@@ -0,0 +1,32 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/crypto/encryptor.h"
+
+#include "base/logging.h"
+
+namespace base {
+
+Encryptor::Encryptor() {
+}
+
+Encryptor::~Encryptor() {
+}
+
+bool Encryptor::Init(SymmetricKey* key, Mode mode, const std::string& iv) {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+bool Encryptor::Encrypt(const std::string& plaintext, std::string* ciphertext) {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+bool Encryptor::Decrypt(const std::string& ciphertext, std::string* plaintext) {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+} // namespace base
diff --git a/base/crypto/rsa_private_key_openssl.cc b/base/crypto/rsa_private_key_openssl.cc
new file mode 100644
index 0000000..ec1d8b5
--- /dev/null
+++ b/base/crypto/rsa_private_key_openssl.cc
@@ -0,0 +1,79 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/crypto/rsa_private_key.h"
+
+#include "base/logging.h"
+
+namespace base {
+
+// static
+RSAPrivateKey* RSAPrivateKey::CreateWithParams(uint16 num_bits,
+ bool permanent,
+ bool sensitive) {
+ NOTIMPLEMENTED();
+ return NULL;
+}
+
+// static
+RSAPrivateKey* RSAPrivateKey::Create(uint16 num_bits) {
+ return CreateWithParams(num_bits,
+ false /* not permanent */,
+ false /* not sensitive */);
+}
+
+// static
+RSAPrivateKey* RSAPrivateKey::CreateSensitive(uint16 num_bits) {
+ return CreateWithParams(num_bits,
+ true /* permanent */,
+ true /* sensitive */);
+}
+
+// static
+RSAPrivateKey* RSAPrivateKey::CreateFromPrivateKeyInfoWithParams(
+ const std::vector<uint8>& input, bool permanent, bool sensitive) {
+ NOTIMPLEMENTED();
+ return NULL;
+}
+
+// static
+RSAPrivateKey* RSAPrivateKey::CreateFromPrivateKeyInfo(
+ const std::vector<uint8>& input) {
+ return CreateFromPrivateKeyInfoWithParams(input,
+ false /* not permanent */,
+ false /* not sensitive */);
+}
+
+// static
+RSAPrivateKey* RSAPrivateKey::CreateSensitiveFromPrivateKeyInfo(
+ const std::vector<uint8>& input) {
+ return CreateFromPrivateKeyInfoWithParams(input,
+ true /* permanent */,
+ true /* seneitive */);
+}
+
+// static
+RSAPrivateKey* RSAPrivateKey::FindFromPublicKeyInfo(
+ const std::vector<uint8>& input) {
+ NOTIMPLEMENTED();
+ return NULL;
+}
+
+RSAPrivateKey::RSAPrivateKey() {
+}
+
+RSAPrivateKey::~RSAPrivateKey() {
+}
+
+bool RSAPrivateKey::ExportPrivateKey(std::vector<uint8>* output) {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+bool RSAPrivateKey::ExportPublicKey(std::vector<uint8>* output) {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+} // namespace base
diff --git a/base/crypto/signature_creator_openssl.cc b/base/crypto/signature_creator_openssl.cc
new file mode 100644
index 0000000..5d70f01
--- /dev/null
+++ b/base/crypto/signature_creator_openssl.cc
@@ -0,0 +1,32 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/crypto/signature_creator.h"
+
+#include "base/logging.h"
+
+namespace base {
+
+// static
+SignatureCreator* SignatureCreator::Create(RSAPrivateKey* key) {
+ return NULL;
+}
+
+SignatureCreator::SignatureCreator() {
+}
+
+SignatureCreator::~SignatureCreator() {
+}
+
+bool SignatureCreator::Update(const uint8* data_part, int data_part_len) {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+bool SignatureCreator::Final(std::vector<uint8>* signature) {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+} // namespace base
diff --git a/base/crypto/signature_verifier_openssl.cc b/base/crypto/signature_verifier_openssl.cc
new file mode 100644
index 0000000..49b5e07
--- /dev/null
+++ b/base/crypto/signature_verifier_openssl.cc
@@ -0,0 +1,41 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/crypto/signature_verifier.h"
+
+#include "base/logging.h"
+
+namespace base {
+
+SignatureVerifier::SignatureVerifier() {
+}
+
+SignatureVerifier::~SignatureVerifier() {
+}
+
+bool SignatureVerifier::VerifyInit(const uint8* signature_algorithm,
+ int signature_algorithm_len,
+ const uint8* signature,
+ int signature_len,
+ const uint8* public_key_info,
+ int public_key_info_len) {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+void SignatureVerifier::VerifyUpdate(const uint8* data_part,
+ int data_part_len) {
+ NOTIMPLEMENTED();
+}
+
+bool SignatureVerifier::VerifyFinal() {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+void SignatureVerifier::Reset() {
+ NOTIMPLEMENTED();
+}
+
+} // namespace base
diff --git a/base/crypto/symmetric_key.h b/base/crypto/symmetric_key.h
index d7259be..3f2be76 100644
--- a/base/crypto/symmetric_key.h
+++ b/base/crypto/symmetric_key.h
@@ -65,7 +65,10 @@ class SymmetricKey {
bool GetRawKey(std::string* raw_key);
private:
-#if defined(USE_NSS)
+#if defined(USE_OPENSSL)
+ // TODO(joth): Add a constructor that accepts OpenSSL symmetric key data, and
+ // the appropriate data members to store it in.
+#elif defined(USE_NSS)
explicit SymmetricKey(PK11SymKey* key);
ScopedPK11SymKey key_;
#elif defined(OS_MACOSX)
diff --git a/base/crypto/symmetric_key_openssl.cc b/base/crypto/symmetric_key_openssl.cc
new file mode 100644
index 0000000..591252d
--- /dev/null
+++ b/base/crypto/symmetric_key_openssl.cc
@@ -0,0 +1,43 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/crypto/symmetric_key.h"
+
+#include "base/logging.h"
+
+namespace base {
+
+SymmetricKey::~SymmetricKey() {
+}
+
+// static
+SymmetricKey* SymmetricKey::GenerateRandomKey(Algorithm algorithm,
+ size_t key_size_in_bits) {
+ NOTIMPLEMENTED();
+ return NULL;
+}
+
+// static
+SymmetricKey* SymmetricKey::DeriveKeyFromPassword(Algorithm algorithm,
+ const std::string& password,
+ const std::string& salt,
+ size_t iterations,
+ size_t key_size_in_bits) {
+ NOTIMPLEMENTED();
+ return NULL;
+}
+
+// static
+SymmetricKey* SymmetricKey::Import(Algorithm algorithm,
+ const std::string& raw_key) {
+ NOTIMPLEMENTED();
+ return NULL;
+}
+
+bool SymmetricKey::GetRawKey(std::string* raw_key) {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+} // namespace base