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

Unified Diff: trunk/Source/platform/exported/WebCryptoKeyAlgorithm.cpp

Issue 296333002: Revert 174726 "[webcrypto] Remove RSA-ES support (3 of 3)" (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Created 6 years, 7 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 | « trunk/Source/platform/exported/WebCryptoAlgorithm.cpp ('k') | trunk/public/platform/WebCryptoAlgorithm.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/Source/platform/exported/WebCryptoKeyAlgorithm.cpp
===================================================================
--- trunk/Source/platform/exported/WebCryptoKeyAlgorithm.cpp (revision 174732)
+++ trunk/Source/platform/exported/WebCryptoKeyAlgorithm.cpp (working copy)
@@ -80,6 +80,12 @@
return WebCryptoKeyAlgorithm(WebCryptoAlgorithmIdHmac, adoptPtr(new WebCryptoHmacKeyAlgorithmParams(createHash(hash), keyLengthBits)));
}
+WebCryptoKeyAlgorithm WebCryptoKeyAlgorithm::createRsa(WebCryptoAlgorithmId id, unsigned modulusLengthBits, const unsigned char* publicExponent, unsigned publicExponentSize)
+{
+ // FIXME: Verify that id is an RSA algorithm without a hash
+ return WebCryptoKeyAlgorithm(id, adoptPtr(new WebCryptoRsaKeyAlgorithmParams(modulusLengthBits, publicExponent, publicExponentSize)));
+}
+
WebCryptoKeyAlgorithm WebCryptoKeyAlgorithm::createRsaHashed(WebCryptoAlgorithmId id, unsigned modulusLengthBits, const unsigned char* publicExponent, unsigned publicExponentSize, WebCryptoAlgorithmId hash)
{
// FIXME: Verify that id is an RSA algorithm which expects a hash
@@ -123,6 +129,14 @@
return 0;
}
+WebCryptoRsaKeyAlgorithmParams* WebCryptoKeyAlgorithm::rsaParams() const
+{
+ ASSERT(!isNull());
+ if (paramsType() == WebCryptoKeyAlgorithmParamsTypeRsa || paramsType() == WebCryptoKeyAlgorithmParamsTypeRsaHashed)
+ return static_cast<WebCryptoRsaKeyAlgorithmParams*>(m_private->params.get());
+ return 0;
+}
+
WebCryptoRsaHashedKeyAlgorithmParams* WebCryptoKeyAlgorithm::rsaHashedParams() const
{
ASSERT(!isNull());
« no previous file with comments | « trunk/Source/platform/exported/WebCryptoAlgorithm.cpp ('k') | trunk/public/platform/WebCryptoAlgorithm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698