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

Unified Diff: content/child/webcrypto/openssl/key_openssl.h

Issue 353043005: [webcrypto] Wire up {spki, pkcs8} import/export for OpenSSL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase on top of https://codereview.chromium.org/379383002/ Created 6 years, 5 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
Index: content/child/webcrypto/openssl/key_openssl.h
diff --git a/content/child/webcrypto/openssl/key_openssl.h b/content/child/webcrypto/openssl/key_openssl.h
index ef3243893106161c24c0a9b7d3bdbd5356d9e1e9..768acafbd1c5c5c279979733e53fabb4860312d9 100644
--- a/content/child/webcrypto/openssl/key_openssl.h
+++ b/content/child/webcrypto/openssl/key_openssl.h
@@ -5,12 +5,16 @@
#ifndef CONTENT_CHILD_WEBCRYPTO_OPENSSL_KEY_OPENSSL_H_
#define CONTENT_CHILD_WEBCRYPTO_OPENSSL_KEY_OPENSSL_H_
+#include <openssl/ossl_typ.h>
+
#include "content/child/webcrypto/algorithm_implementation.h"
+#include "crypto/scoped_openssl_types.h"
namespace content {
namespace webcrypto {
+class AsymKeyOpenSsl;
class SymKeyOpenSsl;
// Base key class for all OpenSSL keys, used to safely cast between types. Each
@@ -23,6 +27,7 @@ class KeyOpenSsl : public blink::WebCryptoKeyHandle {
virtual ~KeyOpenSsl();
virtual SymKeyOpenSsl* AsSymKey();
+ virtual AsymKeyOpenSsl* AsAsymKey();
const std::vector<uint8>& serialized_key_data() const {
return serialized_key_data_;
@@ -49,6 +54,24 @@ class SymKeyOpenSsl : public KeyOpenSsl {
DISALLOW_COPY_AND_ASSIGN(SymKeyOpenSsl);
};
+class AsymKeyOpenSsl : public KeyOpenSsl {
+ public:
+ virtual ~AsymKeyOpenSsl();
+ AsymKeyOpenSsl(crypto::ScopedEVP_PKEY key,
+ const CryptoData& serialized_key_data);
+
+ static AsymKeyOpenSsl* Cast(const blink::WebCryptoKey& key);
+
+ virtual AsymKeyOpenSsl* AsAsymKey() OVERRIDE;
+
+ EVP_PKEY* key() { return key_.get(); }
+
+ private:
+ crypto::ScopedEVP_PKEY key_;
+
+ DISALLOW_COPY_AND_ASSIGN(AsymKeyOpenSsl);
+};
+
} // namespace webcrypto
} // namespace content
« no previous file with comments | « no previous file | content/child/webcrypto/openssl/key_openssl.cc » ('j') | content/child/webcrypto/openssl/rsa_key_openssl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698