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

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: rebase and refactor 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
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
eroman 2014/03/01 01:13:54 This is not currently guranteed as the checks are
padolph 2014/03/01 01:55:01 Done.
+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') | content/renderer/webcrypto/platform_crypto_nss.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698