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

Unified Diff: content/renderer/webcrypto/platform_crypto.h

Issue 118623002: [webcrypto] Add raw symmetric key AES-KW wrap/unwrap for NSS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: changed ASSERTS from last change to EXPECTS, to match original code intent Created 6 years, 10 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/renderer/webcrypto/platform_crypto_nss.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/webcrypto/platform_crypto.h
diff --git a/content/renderer/webcrypto/platform_crypto.h b/content/renderer/webcrypto/platform_crypto.h
index 4b79fd875eaa26fcf139a91c16e5b834ff8f534f..7b0607307442dc177554ddf70d347ae32d4c0133 100644
--- a/content/renderer/webcrypto/platform_crypto.h
+++ b/content/renderer/webcrypto/platform_crypto.h
@@ -176,6 +176,25 @@ Status ExportKeyRaw(SymKey* key, blink::WebArrayBuffer* buffer);
// * |key| is non-null.
Status ExportKeySpki(PublicKey* key, blink::WebArrayBuffer* buffer);
+// Preconditions:
+// * |wrapping_key| is non-null
+// * |key| is non-null
+Status WrapSymKeyAesKw(SymKey* wrapping_key,
+ SymKey* key,
+ blink::WebArrayBuffer* buffer);
+
+// Preconditions:
+// * |wrapping_key| is non-null
+// * |key| is non-null
+// * |algorithm.id()| is for a symmetric key algorithm.
+// * |wrapped_key_data| is at least 24 bytes and a multiple of 8 bytes
+Status UnwrapSymKeyAesKw(const CryptoData& wrapped_key_data,
+ SymKey* wrapping_key,
+ const blink::WebCryptoAlgorithm& algorithm,
+ bool extractable,
+ blink::WebCryptoKeyUsageMask usage_mask,
+ blink::WebCryptoKey* key);
+
} // namespace platform
} // namespace webcrypto
« no previous file with comments | « no previous file | content/renderer/webcrypto/platform_crypto_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698