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

Unified Diff: content/child/webcrypto/test/test_helpers.h

Issue 512023002: Refactor the interface for generating keys. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Run git-cl format Created 6 years, 2 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/openssl/sym_key_openssl.cc ('k') | content/child/webcrypto/test/test_helpers.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/webcrypto/test/test_helpers.h
diff --git a/content/child/webcrypto/test/test_helpers.h b/content/child/webcrypto/test/test_helpers.h
index 6357ce2ad88bdb442d140875354f6cbcaafae682..6f1a31d569714fa9cae6cd3e30fc5b473cf62ea5 100644
--- a/content/child/webcrypto/test/test_helpers.h
+++ b/content/child/webcrypto/test/test_helpers.h
@@ -170,6 +170,19 @@ void ImportExportJwkSymmetricKey(
blink::WebCryptoKeyUsageMask usages,
const std::string& jwk_alg);
+// Wrappers around GenerateKey() which expect the result to be either a secret
+// key or a public/private keypair. If the result does not match the
+// expectation, then it fails with Status::ErrorUnexpected().
+Status GenerateSecretKey(const blink::WebCryptoAlgorithm& algorithm,
+ bool extractable,
+ blink::WebCryptoKeyUsageMask usage_mask,
+ blink::WebCryptoKey* key);
+Status GenerateKeyPair(const blink::WebCryptoAlgorithm& algorithm,
+ bool extractable,
+ blink::WebCryptoKeyUsageMask usage_mask,
+ blink::WebCryptoKey* public_key,
+ blink::WebCryptoKey* private_key);
+
} // namespace webcrypto
} // namesapce content
« no previous file with comments | « content/child/webcrypto/openssl/sym_key_openssl.cc ('k') | content/child/webcrypto/test/test_helpers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698