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

Unified Diff: content/child/webcrypto/webcrypto_impl.cc

Issue 196513002: [webcrypto] Implement structured clone of keys (chromium-side). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase and add header for WebVector Created 6 years, 9 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 | « content/child/webcrypto/webcrypto_impl.h ('k') | content/child/webcrypto/webcrypto_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/webcrypto/webcrypto_impl.cc
diff --git a/content/child/webcrypto/webcrypto_impl.cc b/content/child/webcrypto/webcrypto_impl.cc
index 1af726db71d1c3f839ae362fb983555c1b1077ca..97d1372697c6e6840e96fb6c50056fc85f70d178 100644
--- a/content/child/webcrypto/webcrypto_impl.cc
+++ b/content/child/webcrypto/webcrypto_impl.cc
@@ -207,4 +207,29 @@ bool WebCryptoImpl::digestSynchronous(
.IsSuccess();
}
+bool WebCryptoImpl::deserializeKeyForClone(
+ const blink::WebCryptoKeyAlgorithm& algorithm,
+ blink::WebCryptoKeyType type,
+ bool extractable,
+ blink::WebCryptoKeyUsageMask usages,
+ const unsigned char* key_data,
+ unsigned key_data_size,
+ blink::WebCryptoKey& key) {
+ Status status = webcrypto::DeserializeKeyForClone(
+ algorithm,
+ type,
+ extractable,
+ usages,
+ webcrypto::CryptoData(key_data, key_data_size),
+ &key);
+ return status.IsSuccess();
+}
+
+bool WebCryptoImpl::serializeKeyForClone(
+ const blink::WebCryptoKey& key,
+ blink::WebVector<unsigned char>& key_data) {
+ Status status = webcrypto::SerializeKeyForClone(key, &key_data);
+ return status.IsSuccess();
+}
+
} // namespace content
« no previous file with comments | « content/child/webcrypto/webcrypto_impl.h ('k') | content/child/webcrypto/webcrypto_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698