Changeset 192126 in webkit
- Timestamp:
- Nov 6, 2015 8:44:02 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r192124 r192126 1 2015-11-06 Scott Valentine <svalentine@ikayzo.com> 2 3 Adding new tests for exporting generated RSA keys. 4 https://bugs.webkit.org/show_bug.cgi?id=144938 5 6 Unreviewed initial submission. 7 8 * crypto/subtle/rsa-export-generated-keys-expected.txt: Added. 9 * crypto/subtle/rsa-export-generated-keys.html: Added. 10 1 11 2015-11-06 Wenson Hsieh <wenson_hsieh@apple.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r192124 r192126 1 2015-11-06 Scott Valentine <svalentine@ikayzo.com> 2 3 Allow an optional hash algorithm to be passed to generateKey for RSA keys. 4 https://bugs.webkit.org/show_bug.cgi?id=144938 5 6 Unreviewed initial submission. 7 8 Test: crypto/subtle/rsa-export-generated-keys.html 9 10 This changeset allows an optional hash parameter to be passed to the generate 11 key function for RSA type keys. Previously, there was no way to export generated 12 keys, as no hash function could be associated with the key (required for JWK). 13 14 The current WebCrypto API draft requires the hash function to be specified in the 15 algorithm object passed to generateKey (http://www.w3.org/TR/WebCryptoAPI 20.4), 16 however, they were made optional in this implementation to maintain compatiblity. 17 18 * bindings/js/JSCryptoAlgorithmDictionary.cpp: 19 (WebCore::getHashAlgorithm): 20 (WebCore::createHmacParams): 21 (WebCore::createHmacKeyParams): 22 (WebCore::createRsaKeyGenParams): 23 (WebCore::createRsaOaepParams): 24 (WebCore::createRsaSsaParams): 25 (WebCore::JSCryptoAlgorithmDictionary::createParametersForImportKey): Deleted. 26 * bindings/js/SerializedScriptValue.cpp: 27 (WebCore::CloneDeserializer::readRSAKey): 28 * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp: 29 (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::generateKey): 30 (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey): 31 * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp: 32 (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::generateKey): 33 (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey): 34 * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp: 35 (WebCore::CryptoAlgorithmRSA_OAEP::generateKey): 36 (WebCore::CryptoAlgorithmRSA_OAEP::importKey): 37 * crypto/gnutls/CryptoKeyRSAGnuTLS.cpp: 38 (WebCore::CryptoKeyRSA::CryptoKeyRSA): 39 (WebCore::CryptoKeyRSA::create): 40 (WebCore::CryptoKeyRSA::generatePair): 41 (WebCore::CryptoKeyRSA::restrictToHash): Deleted. 42 * crypto/keys/CryptoKeyRSA.h: 43 * crypto/mac/CryptoKeyRSAMac.cpp: 44 (WebCore::CryptoKeyRSA::CryptoKeyRSA): 45 (WebCore::CryptoKeyRSA::create): 46 (WebCore::CryptoKeyRSA::generatePair): 47 (WebCore::CryptoKeyRSA::restrictToHash): Deleted. 48 * crypto/parameters/CryptoAlgorithmRsaKeyGenParams.h: 49 1 50 2015-11-06 Wenson Hsieh <wenson_hsieh@apple.com> 2 51 -
trunk/Source/WebCore/bindings/js/JSCryptoAlgorithmDictionary.cpp
r182205 r192126 47 47 namespace WebCore { 48 48 49 enum class HashRequirement { 50 Optional, 51 Required, 52 }; 53 49 54 bool JSCryptoAlgorithmDictionary::getAlgorithmIdentifier(ExecState* exec, JSValue value, CryptoAlgorithmIdentifier& algorithmIdentifier) 50 55 { … … 99 104 } 100 105 101 static bool getHashAlgorithm(JSDictionary& dictionary, CryptoAlgorithmIdentifier& result )106 static bool getHashAlgorithm(JSDictionary& dictionary, CryptoAlgorithmIdentifier& result, HashRequirement isRequired) 102 107 { 103 108 // FXIME: Teach JSDictionary how to return JSValues, and use that to get hash element value. … … 114 119 115 120 if (hash.isUndefinedOrNull()) { 116 setDOMException(exec, NOT_SUPPORTED_ERR); 121 if (isRequired == HashRequirement::Required) 122 setDOMException(exec, NOT_SUPPORTED_ERR); 117 123 return false; 118 124 } … … 178 184 auto result = std::make_unique<CryptoAlgorithmHmacParams>(); 179 185 180 if (!getHashAlgorithm(jsDictionary, result->hash )) {186 if (!getHashAlgorithm(jsDictionary, result->hash, HashRequirement::Required)) { 181 187 ASSERT(exec->hadException()); 182 188 return nullptr; … … 196 202 auto result = std::make_unique<CryptoAlgorithmHmacKeyParams>(); 197 203 198 if (!getHashAlgorithm(jsDictionary, result->hash )) {204 if (!getHashAlgorithm(jsDictionary, result->hash, HashRequirement::Required)) { 199 205 ASSERT(exec->hadException()); 200 206 return nullptr; … … 215 221 } 216 222 223 JSDictionary jsDictionary(exec, value.getObject()); 217 224 auto result = std::make_unique<CryptoAlgorithmRsaKeyGenParams>(); 218 225 … … 237 244 result->publicExponent.append(publicExponentArray->data(), publicExponentArray->byteLength()); 238 245 246 result->hasHash = getHashAlgorithm(jsDictionary, result->hash, HashRequirement::Optional); 247 239 248 return WTF::move(result); 240 249 } … … 256 265 auto result = std::make_unique<CryptoAlgorithmRsaOaepParams>(); 257 266 258 if (!getHashAlgorithm(jsDictionary, result->hash )) {267 if (!getHashAlgorithm(jsDictionary, result->hash, HashRequirement::Required)) { 259 268 ASSERT(exec->hadException()); 260 269 return nullptr; … … 290 299 auto result = std::make_unique<CryptoAlgorithmRsaSsaParams>(); 291 300 292 if (!getHashAlgorithm(jsDictionary, result->hash )) {301 if (!getHashAlgorithm(jsDictionary, result->hash, HashRequirement::Required)) { 293 302 ASSERT(exec->hadException()); 294 303 return nullptr; … … 598 607 switch (algorithm) { 599 608 case CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5: 600 return std::make_unique<CryptoAlgorithmParameters>(); 601 case CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5: 609 case CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5: 610 case CryptoAlgorithmIdentifier::RSA_PSS: 611 case CryptoAlgorithmIdentifier::RSA_OAEP: 602 612 return createRsaKeyParamsWithHash(exec, value); 603 case CryptoAlgorithmIdentifier::RSA_PSS:604 return std::make_unique<CryptoAlgorithmParameters>();605 case CryptoAlgorithmIdentifier::RSA_OAEP:606 return createRsaKeyParamsWithHash(exec, value);607 613 case CryptoAlgorithmIdentifier::ECDSA: 608 614 case CryptoAlgorithmIdentifier::ECDH: -
trunk/Source/WebCore/bindings/js/JSCryptoKeySerializationJWK.cpp
r182205 r192126 194 194 } else if (m_jwkAlgorithmName == "RSA1_5") { 195 195 algorithm = algorithmRegisty.create(CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5); 196 parameters = std::make_unique<CryptoAlgorithm Parameters>();196 parameters = std::make_unique<CryptoAlgorithmRsaKeyParamsWithHash>(); 197 197 } else if (m_jwkAlgorithmName == "RSA-OAEP") { 198 198 algorithm = algorithmRegisty.create(CryptoAlgorithmIdentifier::RSA_OAEP); -
trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp
r190838 r192126 2024 2024 if (type == CryptoKeyAsymmetricTypeSubtag::Public) { 2025 2025 auto keyData = CryptoKeyDataRSAComponents::createPublic(modulus, exponent); 2026 auto key = CryptoKeyRSA::create(algorithm, *keyData, extractable, usages); 2027 if (isRestrictedToHash) 2028 key->restrictToHash(hash); 2026 auto key = CryptoKeyRSA::create(algorithm, hash, isRestrictedToHash, *keyData, extractable, usages); 2029 2027 result = WTF::move(key); 2030 2028 return true; … … 2041 2039 if (!primeCount) { 2042 2040 auto keyData = CryptoKeyDataRSAComponents::createPrivate(modulus, exponent, privateExponent); 2043 auto key = CryptoKeyRSA::create(algorithm, *keyData, extractable, usages); 2044 if (isRestrictedToHash) 2045 key->restrictToHash(hash); 2041 auto key = CryptoKeyRSA::create(algorithm, hash, isRestrictedToHash, *keyData, extractable, usages); 2046 2042 result = WTF::move(key); 2047 2043 return true; … … 2075 2071 2076 2072 auto keyData = CryptoKeyDataRSAComponents::createPrivateWithAdditionalData(modulus, exponent, privateExponent, firstPrimeInfo, secondPrimeInfo, otherPrimeInfos); 2077 auto key = CryptoKeyRSA::create(algorithm, *keyData, extractable, usages); 2078 if (isRestrictedToHash) 2079 key->restrictToHash(hash); 2073 auto key = CryptoKeyRSA::create(algorithm, hash, isRestrictedToHash, *keyData, extractable, usages); 2080 2074 result = WTF::move(key); 2081 2075 return true; -
trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp
r188118 r192126 30 30 31 31 #include "CryptoAlgorithmRsaKeyGenParams.h" 32 #include "CryptoAlgorithmRsaKeyParamsWithHash.h" 32 33 #include "CryptoKeyDataRSAComponents.h" 33 34 #include "CryptoKeyRSA.h" … … 93 94 }; 94 95 95 CryptoKeyRSA::generatePair(CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5, rsaParameters. modulusLength, rsaParameters.publicExponent, extractable, usages, WTF::move(keyPairCallback), WTF::move(failureCallback));96 CryptoKeyRSA::generatePair(CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5, rsaParameters.hash, rsaParameters.hasHash, rsaParameters.modulusLength, rsaParameters.publicExponent, extractable, usages, WTF::move(keyPairCallback), WTF::move(failureCallback)); 96 97 } 97 98 98 void CryptoAlgorithmRSAES_PKCS1_v1_5::importKey(const CryptoAlgorithmParameters& , const CryptoKeyData& keyData, bool extractable, CryptoKeyUsage usage, KeyCallback&& callback, VoidCallback&& failureCallback, ExceptionCode&)99 void CryptoAlgorithmRSAES_PKCS1_v1_5::importKey(const CryptoAlgorithmParameters& parameters, const CryptoKeyData& keyData, bool extractable, CryptoKeyUsage usage, KeyCallback&& callback, VoidCallback&& failureCallback, ExceptionCode&) 99 100 { 101 const CryptoAlgorithmRsaKeyParamsWithHash& rsaParameters = downcast<CryptoAlgorithmRsaKeyParamsWithHash>(parameters); 100 102 const CryptoKeyDataRSAComponents& rsaComponents = downcast<CryptoKeyDataRSAComponents>(keyData); 101 103 102 RefPtr<CryptoKeyRSA> result = CryptoKeyRSA::create(CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5, rsa Components, extractable, usage);104 RefPtr<CryptoKeyRSA> result = CryptoKeyRSA::create(CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5, rsaParameters.hash, rsaParameters.hasHash, rsaComponents, extractable, usage); 103 105 if (!result) { 104 106 failureCallback(); -
trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp
r188118 r192126 102 102 }; 103 103 104 CryptoKeyRSA::generatePair(CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5, rsaParameters. modulusLength, rsaParameters.publicExponent, extractable, usages, WTF::move(keyPairCallback), WTF::move(failureCallback));104 CryptoKeyRSA::generatePair(CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5, rsaParameters.hash, rsaParameters.hasHash, rsaParameters.modulusLength, rsaParameters.publicExponent, extractable, usages, WTF::move(keyPairCallback), WTF::move(failureCallback)); 105 105 } 106 106 … … 110 110 const CryptoKeyDataRSAComponents& rsaComponents = downcast<CryptoKeyDataRSAComponents>(keyData); 111 111 112 RefPtr<CryptoKeyRSA> result = CryptoKeyRSA::create(CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5, rsa Components, extractable, usage);112 RefPtr<CryptoKeyRSA> result = CryptoKeyRSA::create(CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5, rsaKeyParameters.hash, rsaKeyParameters.hasHash, rsaComponents, extractable, usage); 113 113 if (!result) { 114 114 failureCallback(); 115 115 return; 116 116 } 117 118 if (rsaKeyParameters.hasHash)119 result->restrictToHash(rsaKeyParameters.hash);120 117 121 118 callback(*result); -
trunk/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp
r188118 r192126 102 102 }; 103 103 104 CryptoKeyRSA::generatePair(CryptoAlgorithmIdentifier::RSA_OAEP, rsaParameters. modulusLength, rsaParameters.publicExponent, extractable, usages, WTF::move(keyPairCallback), WTF::move(failureCallback));104 CryptoKeyRSA::generatePair(CryptoAlgorithmIdentifier::RSA_OAEP, rsaParameters.hash, rsaParameters.hasHash, rsaParameters.modulusLength, rsaParameters.publicExponent, extractable, usages, WTF::move(keyPairCallback), WTF::move(failureCallback)); 105 105 } 106 106 … … 110 110 const CryptoKeyDataRSAComponents& rsaComponents = downcast<CryptoKeyDataRSAComponents>(keyData); 111 111 112 RefPtr<CryptoKeyRSA> result = CryptoKeyRSA::create(CryptoAlgorithmIdentifier::RSA_OAEP, rsa Components, extractable, usage);112 RefPtr<CryptoKeyRSA> result = CryptoKeyRSA::create(CryptoAlgorithmIdentifier::RSA_OAEP, rsaKeyParameters.hash, rsaKeyParameters.hasHash, rsaComponents, extractable, usage); 113 113 if (!result) { 114 114 failureCallback(); 115 115 return; 116 116 } 117 118 if (rsaKeyParameters.hasHash)119 result->restrictToHash(rsaKeyParameters.hash);120 117 121 118 callback(*result); -
trunk/Source/WebCore/crypto/gnutls/CryptoKeyRSAGnuTLS.cpp
r189675 r192126 40 40 }; 41 41 42 CryptoKeyRSA::CryptoKeyRSA(CryptoAlgorithmIdentifier identifier, Crypto KeyType type, PlatformRSAKey platformKey, bool extractable, CryptoKeyUsage usage)42 CryptoKeyRSA::CryptoKeyRSA(CryptoAlgorithmIdentifier identifier, CryptoAlgorithmIdentifier hash, bool hasHash, CryptoKeyType type, PlatformRSAKey platformKey, bool extractable, CryptoKeyUsage usage) 43 43 : CryptoKey(identifier, type, extractable, usage) 44 44 , m_platformKey(platformKey) 45 , m_restrictedToSpecificHash(false) 45 , m_restrictedToSpecificHash(hasHash) 46 , m_hash(hash) 46 47 { 47 48 notImplemented(); 48 49 } 49 50 50 RefPtr<CryptoKeyRSA> CryptoKeyRSA::create(CryptoAlgorithmIdentifier identifier, const CryptoKeyDataRSAComponents& keyData, bool extractable, CryptoKeyUsage usage)51 RefPtr<CryptoKeyRSA> CryptoKeyRSA::create(CryptoAlgorithmIdentifier identifier, CryptoAlgorithmIdentifier hash, bool hasHash, const CryptoKeyDataRSAComponents& keyData, bool extractable, CryptoKeyUsage usage) 51 52 { 52 53 notImplemented(); 53 54 UNUSED_PARAM(identifier); 55 UNUSED_PARAM(hash); 56 UNUSED_PARAM(hasHash); 54 57 UNUSED_PARAM(keyData); 55 58 UNUSED_PARAM(extractable); … … 62 65 { 63 66 notImplemented(); 64 }65 66 void CryptoKeyRSA::restrictToHash(CryptoAlgorithmIdentifier identifier)67 {68 m_restrictedToSpecificHash = true;69 m_hash = identifier;70 67 } 71 68 … … 99 96 } 100 97 101 void CryptoKeyRSA::generatePair(CryptoAlgorithmIdentifier algorithm, unsigned modulusLength, const Vector<uint8_t>& publicExponent, bool extractable, CryptoKeyUsage usage, KeyPairCallback callback, VoidCallback failureCallback)98 void CryptoKeyRSA::generatePair(CryptoAlgorithmIdentifier algorithm, CryptoAlgorithmIdentifier hash, bool hasHash, unsigned modulusLength, const Vector<uint8_t>& publicExponent, bool extractable, CryptoKeyUsage usage, KeyPairCallback callback, VoidCallback failureCallback) 102 99 { 103 100 notImplemented(); … … 105 102 106 103 UNUSED_PARAM(algorithm); 104 UNUSED_PARAM(hash); 105 UNUSED_PARAM(hasHash); 107 106 UNUSED_PARAM(modulusLength); 108 107 UNUSED_PARAM(publicExponent); -
trunk/Source/WebCore/crypto/keys/CryptoKeyRSA.h
r189675 r192126 50 50 class CryptoKeyRSA final : public CryptoKey { 51 51 public: 52 static Ref<CryptoKeyRSA> create(CryptoAlgorithmIdentifier identifier, Crypto KeyType type, PlatformRSAKey platformKey, bool extractable, CryptoKeyUsage usage)52 static Ref<CryptoKeyRSA> create(CryptoAlgorithmIdentifier identifier, CryptoAlgorithmIdentifier hash, bool hasHash, CryptoKeyType type, PlatformRSAKey platformKey, bool extractable, CryptoKeyUsage usage) 53 53 { 54 return adoptRef(*new CryptoKeyRSA(identifier, type, platformKey, extractable, usage));54 return adoptRef(*new CryptoKeyRSA(identifier, hash, hasHash, type, platformKey, extractable, usage)); 55 55 } 56 static RefPtr<CryptoKeyRSA> create(CryptoAlgorithmIdentifier, const CryptoKeyDataRSAComponents&, bool extractable, CryptoKeyUsage);56 static RefPtr<CryptoKeyRSA> create(CryptoAlgorithmIdentifier, CryptoAlgorithmIdentifier hash, bool hasHash, const CryptoKeyDataRSAComponents&, bool extractable, CryptoKeyUsage); 57 57 virtual ~CryptoKeyRSA(); 58 58 59 void restrictToHash(CryptoAlgorithmIdentifier);60 59 bool isRestrictedToHash(CryptoAlgorithmIdentifier&) const; 61 60 … … 64 63 typedef std::function<void(CryptoKeyPair&)> KeyPairCallback; 65 64 typedef std::function<void()> VoidCallback; 66 static void generatePair(CryptoAlgorithmIdentifier, unsigned modulusLength, const Vector<uint8_t>& publicExponent, bool extractable, CryptoKeyUsage, KeyPairCallback, VoidCallback failureCallback);65 static void generatePair(CryptoAlgorithmIdentifier, CryptoAlgorithmIdentifier hash, bool hasHash, unsigned modulusLength, const Vector<uint8_t>& publicExponent, bool extractable, CryptoKeyUsage, KeyPairCallback, VoidCallback failureCallback); 67 66 68 67 PlatformRSAKey platformKey() const { return m_platformKey; } 69 68 70 69 private: 71 CryptoKeyRSA(CryptoAlgorithmIdentifier, Crypto KeyType, PlatformRSAKey, bool extractable, CryptoKeyUsage);70 CryptoKeyRSA(CryptoAlgorithmIdentifier, CryptoAlgorithmIdentifier hash, bool hasHash, CryptoKeyType, PlatformRSAKey, bool extractable, CryptoKeyUsage); 72 71 73 72 virtual CryptoKeyClass keyClass() const override { return CryptoKeyClass::RSA; } -
trunk/Source/WebCore/crypto/mac/CryptoKeyRSAMac.cpp
r189675 r192126 97 97 } 98 98 99 CryptoKeyRSA::CryptoKeyRSA(CryptoAlgorithmIdentifier identifier, Crypto KeyType type, PlatformRSAKey platformKey, bool extractable, CryptoKeyUsage usage)99 CryptoKeyRSA::CryptoKeyRSA(CryptoAlgorithmIdentifier identifier, CryptoAlgorithmIdentifier hash, bool hasHash, CryptoKeyType type, PlatformRSAKey platformKey, bool extractable, CryptoKeyUsage usage) 100 100 : CryptoKey(identifier, type, extractable, usage) 101 101 , m_platformKey(platformKey) 102 , m_restrictedToSpecificHash(false) 103 { 104 } 105 106 RefPtr<CryptoKeyRSA> CryptoKeyRSA::create(CryptoAlgorithmIdentifier identifier, const CryptoKeyDataRSAComponents& keyData, bool extractable, CryptoKeyUsage usage) 102 , m_restrictedToSpecificHash(hasHash) 103 , m_hash(hash) 104 { 105 } 106 107 RefPtr<CryptoKeyRSA> CryptoKeyRSA::create(CryptoAlgorithmIdentifier identifier, CryptoAlgorithmIdentifier hash, bool hasHash, const CryptoKeyDataRSAComponents& keyData, bool extractable, CryptoKeyUsage usage) 107 108 { 108 109 if (keyData.type() == CryptoKeyDataRSAComponents::Type::Private && !keyData.hasAdditionalPrivateKeyParameters()) { … … 130 131 } 131 132 132 return adoptRef(new CryptoKeyRSA(identifier, keyData.type() == CryptoKeyDataRSAComponents::Type::Public ? CryptoKeyType::Public : CryptoKeyType::Private, cryptor, extractable, usage));133 return adoptRef(new CryptoKeyRSA(identifier, hash, hasHash, keyData.type() == CryptoKeyDataRSAComponents::Type::Public ? CryptoKeyType::Public : CryptoKeyType::Private, cryptor, extractable, usage)); 133 134 } 134 135 … … 136 137 { 137 138 CCRSACryptorRelease(m_platformKey); 138 }139 140 void CryptoKeyRSA::restrictToHash(CryptoAlgorithmIdentifier identifier)141 {142 m_restrictedToSpecificHash = true;143 m_hash = identifier;144 139 } 145 140 … … 240 235 } 241 236 242 void CryptoKeyRSA::generatePair(CryptoAlgorithmIdentifier algorithm, unsigned modulusLength, const Vector<uint8_t>& publicExponent, bool extractable, CryptoKeyUsage usage, KeyPairCallback callback, VoidCallback failureCallback)237 void CryptoKeyRSA::generatePair(CryptoAlgorithmIdentifier algorithm, CryptoAlgorithmIdentifier hash, bool hasHash, unsigned modulusLength, const Vector<uint8_t>& publicExponent, bool extractable, CryptoKeyUsage usage, KeyPairCallback callback, VoidCallback failureCallback) 243 238 { 244 239 uint32_t e; … … 268 263 } 269 264 callOnWebThreadOrDispatchAsyncOnMainThread(^{ 270 RefPtr<CryptoKeyRSA> publicKey = CryptoKeyRSA::create(algorithm, CryptoKeyType::Public, ccPublicKey, true, usage);271 RefPtr<CryptoKeyRSA> privateKey = CryptoKeyRSA::create(algorithm, CryptoKeyType::Private, ccPrivateKey, extractable, usage);265 RefPtr<CryptoKeyRSA> publicKey = CryptoKeyRSA::create(algorithm, hash, hasHash, CryptoKeyType::Public, ccPublicKey, true, usage); 266 RefPtr<CryptoKeyRSA> privateKey = CryptoKeyRSA::create(algorithm, hash, hasHash, CryptoKeyType::Private, ccPrivateKey, extractable, usage); 272 267 (*localCallback)(CryptoKeyPair::create(publicKey.release(), privateKey.release())); 273 268 delete localCallback; -
trunk/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaKeyGenParams.h
r174331 r192126 36 36 class CryptoAlgorithmRsaKeyGenParams final : public CryptoAlgorithmParameters { 37 37 public: 38 CryptoAlgorithmRsaKeyGenParams() 39 : hasHash(false) 40 { 41 } 38 42 // The length, in bits, of the RSA modulus. 39 43 unsigned modulusLength; 40 44 // The RSA public exponent, encoded as BigInteger. 41 45 Vector<uint8_t> publicExponent; 46 // The hash algorith identifier 47 bool hasHash; 48 CryptoAlgorithmIdentifier hash; 42 49 43 50 virtual Class parametersClass() const override { return Class::RsaKeyGenParams; }
Note: See TracChangeset
for help on using the changeset viewer.