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