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

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 onto master (which no longer has boringssl) 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
« no previous file with comments | « no previous file | content/child/webcrypto/openssl/key_openssl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 34e758d32f2ff893ad4687b22fca85acce5b195d..e25eae4b80a707a714393cd8cbc4b1e0d941f817 100644
--- a/content/child/webcrypto/openssl/key_openssl.h
+++ b/content/child/webcrypto/openssl/key_openssl.h
@@ -5,10 +5,12 @@
#ifndef CONTENT_CHILD_WEBCRYPTO_OPENSSL_KEY_OPENSSL_H_
#define CONTENT_CHILD_WEBCRYPTO_OPENSSL_KEY_OPENSSL_H_
+#include <openssl/ossl_typ.h>
#include <stdint.h>
#include <vector>
#include "base/macros.h"
+#include "crypto/scoped_openssl_types.h"
#include "third_party/WebKit/public/platform/WebCryptoKey.h"
namespace content {
@@ -16,6 +18,7 @@ namespace content {
namespace webcrypto {
class CryptoData;
+class AsymKeyOpenSsl;
class SymKeyOpenSsl;
// Base key class for all OpenSSL keys, used to safely cast between types. Each
@@ -28,6 +31,7 @@ class KeyOpenSsl : public blink::WebCryptoKeyHandle {
virtual ~KeyOpenSsl();
virtual SymKeyOpenSsl* AsSymKey();
+ virtual AsymKeyOpenSsl* AsAsymKey();
const std::vector<uint8_t>& serialized_key_data() const {
return serialized_key_data_;
@@ -54,6 +58,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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698