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); |
} |