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

Unified Diff: Source/modules/crypto/RsaKeyGenParams.cpp

Issue 21759002: WebCrypto: Add algorithm normalization rules for RSASSA-PKCS1-v1_5. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase onto master Created 7 years, 5 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 | « Source/modules/crypto/RsaKeyGenParams.h ('k') | Source/modules/crypto/RsaKeyGenParams.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/crypto/RsaKeyGenParams.cpp
diff --git a/Source/modules/crypto/AesKeyGenParams.cpp b/Source/modules/crypto/RsaKeyGenParams.cpp
similarity index 75%
copy from Source/modules/crypto/AesKeyGenParams.cpp
copy to Source/modules/crypto/RsaKeyGenParams.cpp
index 2fa560c367bfe2b5e97508575a6e366355cea57f..69a9e6763d6e4574c31dfba56b65fabdd780934b 100644
--- a/Source/modules/crypto/AesKeyGenParams.cpp
+++ b/Source/modules/crypto/RsaKeyGenParams.cpp
@@ -29,20 +29,30 @@
*/
#include "config.h"
-#include "modules/crypto/AesKeyGenParams.h"
+#include "modules/crypto/RsaKeyGenParams.h"
#include "public/platform/WebCryptoAlgorithmParams.h"
namespace WebCore {
-unsigned short AesKeyGenParams::length() const
+unsigned RsaKeyGenParams::modulusLength() const
{
- return m_algorithm.aesKeyGenParams()->length();
+ return m_algorithm.rsaKeyGenParams()->modulusLength();
}
-AesKeyGenParams::AesKeyGenParams(const WebKit::WebCryptoAlgorithm& algorithm)
+Uint8Array* RsaKeyGenParams::publicExponent()
+{
+ if (!m_publicExponent) {
+ const WebKit::WebVector<unsigned char>& exponent = m_algorithm.rsaKeyGenParams()->publicExponent();
+ m_publicExponent = Uint8Array::create(exponent.data(), exponent.size());
+ }
+ return m_publicExponent.get();
+}
+
+RsaKeyGenParams::RsaKeyGenParams(const WebKit::WebCryptoAlgorithm& algorithm)
: Algorithm(algorithm)
{
+ ASSERT(algorithm.rsaKeyGenParams());
ScriptWrappable::init(this);
}
« no previous file with comments | « Source/modules/crypto/RsaKeyGenParams.h ('k') | Source/modules/crypto/RsaKeyGenParams.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698