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

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

Issue 178073007: [webcrypto] Update to use the KeyAlgorithm. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove unrelated change that makes public keys extractable 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 | « content/renderer/webcrypto/webcrypto_impl.cc ('k') | content/renderer/webcrypto/webcrypto_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/webcrypto/webcrypto_util.h
diff --git a/content/renderer/webcrypto/webcrypto_util.h b/content/renderer/webcrypto/webcrypto_util.h
index a9383e1aad9764462cb73cd3c89015410b069d94..6c790d35235c559c3d10e996247511be4d89d8b0 100644
--- a/content/renderer/webcrypto/webcrypto_util.h
+++ b/content/renderer/webcrypto/webcrypto_util.h
@@ -10,6 +10,7 @@
#include "base/basictypes.h"
#include "content/common/content_export.h"
#include "third_party/WebKit/public/platform/WebArrayBuffer.h"
+#include "third_party/WebKit/public/platform/WebCrypto.h" // TODO(eroman): delete
#include "third_party/WebKit/public/platform/WebCryptoAlgorithm.h"
#include "third_party/WebKit/public/platform/WebCryptoKey.h"
@@ -217,49 +218,36 @@ blink::WebCryptoAlgorithm GetInnerHashAlgorithm(
CONTENT_EXPORT blink::WebCryptoAlgorithm CreateAlgorithm(
blink::WebCryptoAlgorithmId id);
-// Creates an HMAC algorithm whose inner hash algorithm is determined by the
-// specified algorithm ID. It is an error to call this method with a hash
+// Creates an HMAC import algorithm whose inner hash algorithm is determined by
+// the specified algorithm ID. It is an error to call this method with a hash
// algorithm that is not SHA*.
-CONTENT_EXPORT blink::WebCryptoAlgorithm CreateHmacAlgorithmByHashId(
+CONTENT_EXPORT blink::WebCryptoAlgorithm CreateHmacImportAlgorithm(
blink::WebCryptoAlgorithmId hash_id);
-// Creates an HMAC algorithm whose parameters struct is compatible with key
-// generation. It is an error to call this with a hash_id that is not a SHA*.
-// The key_length_bytes parameter is optional, with zero meaning unspecified.
-CONTENT_EXPORT blink::WebCryptoAlgorithm CreateHmacKeyGenAlgorithm(
- blink::WebCryptoAlgorithmId hash_id,
- unsigned int key_length_bytes);
-
// Creates an RSASSA-PKCS1-v1_5 algorithm. It is an error to call this with a
// hash_id that is not a SHA*.
-blink::WebCryptoAlgorithm CreateRsaSsaAlgorithm(
+blink::WebCryptoAlgorithm CreateRsaSsaImportAlgorithm(
blink::WebCryptoAlgorithmId hash_id);
// Creates an RSA-OAEP algorithm. It is an error to call this with a hash_id
// that is not a SHA*.
-blink::WebCryptoAlgorithm CreateRsaOaepAlgorithm(
+blink::WebCryptoAlgorithm CreateRsaOaepImportAlgorithm(
blink::WebCryptoAlgorithmId hash_id);
-// Creates an RSA algorithm with ID algorithm_id, whose parameters struct is
-// compatible with key generation.
-CONTENT_EXPORT blink::WebCryptoAlgorithm CreateRsaKeyGenAlgorithm(
- blink::WebCryptoAlgorithmId algorithm_id,
- unsigned int modulus_length,
- const std::vector<uint8>& public_exponent);
-
-// Creates an AES-CBC algorithm.
-CONTENT_EXPORT blink::WebCryptoAlgorithm CreateAesCbcAlgorithm(
- const std::vector<uint8>& iv);
-
-// Creates and AES-GCM algorithm.
-blink::WebCryptoAlgorithm CreateAesGcmAlgorithm(
- const std::vector<uint8>& iv,
- const std::vector<uint8>& additional_data,
- uint8 tag_length_bytes);
-
+// TODO(eroman): Move to shared_crypto.cc
// Returns the internal block size for SHA-*
unsigned int ShaBlockSizeBytes(blink::WebCryptoAlgorithmId hash_id);
+#ifdef WEBCRYPTO_HAS_KEY_ALGORITHM
+bool CreateSecretKeyAlgorithm(const blink::WebCryptoAlgorithm& algorithm,
+ unsigned keylen_bytes,
+ blink::WebCryptoKeyAlgorithm* key_algorithm);
+#else
+bool CreateSecretKeyAlgorithm(const blink::WebCryptoAlgorithm& algorithm,
+ unsigned keylen_bytes,
+ blink::WebCryptoAlgorithm* key_algorithm);
+#endif
+
} // namespace webcrypto
} // namespace content
« no previous file with comments | « content/renderer/webcrypto/webcrypto_impl.cc ('k') | content/renderer/webcrypto/webcrypto_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698