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

Unified Diff: Source/testing/runner/MockWebCrypto.cpp

Issue 23592023: WebCrypto: Add interface for exportKey(). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase, add test expectations, remove platformCrypto nullity check Created 7 years, 4 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 | « Source/testing/runner/MockWebCrypto.h ('k') | public/platform/WebCrypto.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/testing/runner/MockWebCrypto.cpp
diff --git a/Source/testing/runner/MockWebCrypto.cpp b/Source/testing/runner/MockWebCrypto.cpp
index 48e9a2209f7058e2ca53d6f47d613aa98d7f0a54..a0b48af7567f11da428ec0e56b098f12fd5f2f28 100644
--- a/Source/testing/runner/MockWebCrypto.cpp
+++ b/Source/testing/runner/MockWebCrypto.cpp
@@ -125,4 +125,17 @@ void MockWebCrypto::importKey(WebKit::WebCryptoKeyFormat, const unsigned char* k
result.completeWithKey(WebKit::WebCryptoKey::create(0, type, extractable, algorithm, usages));
}
+void MockWebCrypto::exportKey(WebKit::WebCryptoKeyFormat format, const WebKit::WebCryptoKey& key, WebKit::WebCryptoResult result)
+{
+ std::string buffer;
+
+ if (format == WebKit::WebCryptoKeyFormatRaw)
+ buffer = "raw";
+ else if (format == WebKit::WebCryptoKeyFormatPkcs8)
+ buffer = "pkcs8";
+
+ result.completeWithBuffer(buffer.data(), buffer.size());
+}
+
+
} // namespace WebTestRunner
« no previous file with comments | « Source/testing/runner/MockWebCrypto.h ('k') | public/platform/WebCrypto.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698