[WebIDL] Replace JSCryptoKeyCustom and JSCryptoAlgorithmBuilder with generated code
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 12 Aug 2017 00:07:00 +0000 (00:07 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 12 Aug 2017 00:07:00 +0000 (00:07 +0000)
https://bugs.webkit.org/show_bug.cgi?id=175457

Patch by Sam Weinig <sam@webkit.org> on 2017-08-11
Reviewed by Chris Dumez.

* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSCryptoAlgorithmBuilder.cpp: Removed.
* bindings/js/JSCryptoAlgorithmBuilder.h: Removed.
* bindings/js/JSCryptoKeyCustom.cpp: Removed.

    Remove JSCryptoAlgorithmBuilder and JSCryptoKeyCustom, add KeyAlgorithm
    IDLs and headers.

* crypto/CryptoKey.cpp:
* crypto/CryptoKey.h:
* crypto/CryptoKey.idl:

    Replace custom algorithm attribute with a union of the supported key algorithms.

* crypto/keys/CryptoAesKeyAlgorithm.h: Added.
* crypto/keys/CryptoAesKeyAlgorithm.idl: Added.
* crypto/keys/CryptoEcKeyAlgorithm.h: Added.
* crypto/keys/CryptoEcKeyAlgorithm.idl: Added.
* crypto/keys/CryptoHmacKeyAlgorithm.h: Added.
* crypto/keys/CryptoHmacKeyAlgorithm.idl: Added.
* crypto/keys/CryptoKeyAlgorithm.h: Added.
* crypto/keys/CryptoKeyAlgorithm.idl: Added.
* crypto/keys/CryptoRsaHashedKeyAlgorithm.h: Added.
* crypto/keys/CryptoRsaHashedKeyAlgorithm.idl: Added.
* crypto/keys/CryptoRsaKeyAlgorithm.h: Added.
* crypto/keys/CryptoRsaKeyAlgorithm.idl: Added.

    Add IDLs and headers fo the supported key algorithms.

* crypto/keys/CryptoKeyAES.h:
* crypto/keys/CryptoKeyEC.h:
* crypto/keys/CryptoKeyHMAC.h:
* crypto/keys/CryptoKeyRSA.h:
* crypto/keys/CryptoKeyRaw.h:

    Give each of the existing KeyAlgorithm subclasses a dictionary() function
    that returns the populated corresponding spec'd dictionary.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220619 268f45cc-cd09-0410-ab3c-d52691b4dbfc

31 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.make
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/JSCryptoAlgorithmBuilder.cpp [deleted file]
Source/WebCore/bindings/js/JSCryptoKeyCustom.cpp [deleted file]
Source/WebCore/crypto/CryptoKey.cpp
Source/WebCore/crypto/CryptoKey.h
Source/WebCore/crypto/CryptoKey.idl
Source/WebCore/crypto/keys/CryptoAesKeyAlgorithm.h [new file with mode: 0644]
Source/WebCore/crypto/keys/CryptoAesKeyAlgorithm.idl [new file with mode: 0644]
Source/WebCore/crypto/keys/CryptoEcKeyAlgorithm.h [new file with mode: 0644]
Source/WebCore/crypto/keys/CryptoEcKeyAlgorithm.idl [new file with mode: 0644]
Source/WebCore/crypto/keys/CryptoHmacKeyAlgorithm.h [new file with mode: 0644]
Source/WebCore/crypto/keys/CryptoHmacKeyAlgorithm.idl [new file with mode: 0644]
Source/WebCore/crypto/keys/CryptoKeyAES.cpp
Source/WebCore/crypto/keys/CryptoKeyAES.h
Source/WebCore/crypto/keys/CryptoKeyAlgorithm.h [moved from Source/WebCore/bindings/js/JSCryptoAlgorithmBuilder.h with 64% similarity]
Source/WebCore/crypto/keys/CryptoKeyAlgorithm.idl [new file with mode: 0644]
Source/WebCore/crypto/keys/CryptoKeyEC.cpp
Source/WebCore/crypto/keys/CryptoKeyEC.h
Source/WebCore/crypto/keys/CryptoKeyHMAC.cpp
Source/WebCore/crypto/keys/CryptoKeyHMAC.h
Source/WebCore/crypto/keys/CryptoKeyRSA.cpp
Source/WebCore/crypto/keys/CryptoKeyRSA.h
Source/WebCore/crypto/keys/CryptoKeyRaw.cpp
Source/WebCore/crypto/keys/CryptoKeyRaw.h
Source/WebCore/crypto/keys/CryptoRsaHashedKeyAlgorithm.h [new file with mode: 0644]
Source/WebCore/crypto/keys/CryptoRsaHashedKeyAlgorithm.idl [new file with mode: 0644]
Source/WebCore/crypto/keys/CryptoRsaKeyAlgorithm.h [new file with mode: 0644]
Source/WebCore/crypto/keys/CryptoRsaKeyAlgorithm.idl [new file with mode: 0644]

index 6481631e8f6ad5a1d1f6ff190ad863e47d355143..8813dfc022dd1ac4b255f2fdb825aae2be305adf 100644 (file)
@@ -376,6 +376,13 @@ set(WebCore_NON_SVG_IDL_FILES
     crypto/SubtleCrypto.idl
     crypto/WebKitSubtleCrypto.idl
 
+    crypto/keys/CryptoAesKeyAlgorithm.idl
+    crypto/keys/CryptoEcKeyAlgorithm.idl
+    crypto/keys/CryptoHmacKeyAlgorithm.idl
+    crypto/keys/CryptoKeyAlgorithm.idl
+    crypto/keys/CryptoRsaHashedKeyAlgorithm.idl
+    crypto/keys/CryptoRsaKeyAlgorithm.idl
+
     crypto/parameters/AesCbcCfbParams.idl
     crypto/parameters/AesCtrParams.idl
     crypto/parameters/AesGcmParams.idl
@@ -1181,9 +1188,7 @@ set(WebCore_SOURCES
     bindings/js/JSDeprecatedCSSOMValueCustom.cpp
     bindings/js/JSCallbackData.cpp
     bindings/js/JSCanvasRenderingContext2DCustom.cpp
-    bindings/js/JSCryptoAlgorithmBuilder.cpp
     bindings/js/JSCryptoAlgorithmDictionary.cpp
-    bindings/js/JSCryptoKeyCustom.cpp
     bindings/js/JSCryptoKeySerializationJWK.cpp
     bindings/js/JSCryptoOperationData.cpp
     bindings/js/JSCustomElementInterface.cpp
index ec2b108faf01c20ab867452300e28e9e3bcc5164..3b1805960dd0996c342a362b6eb7aa19d7635997 100644 (file)
@@ -1,3 +1,50 @@
+2017-08-11  Sam Weinig  <sam@webkit.org>
+
+        [WebIDL] Replace JSCryptoKeyCustom and JSCryptoAlgorithmBuilder with generated code
+        https://bugs.webkit.org/show_bug.cgi?id=175457
+
+        Reviewed by Chris Dumez.
+
+        * CMakeLists.txt:
+        * DerivedSources.make:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSCryptoAlgorithmBuilder.cpp: Removed.
+        * bindings/js/JSCryptoAlgorithmBuilder.h: Removed.
+        * bindings/js/JSCryptoKeyCustom.cpp: Removed.
+
+            Remove JSCryptoAlgorithmBuilder and JSCryptoKeyCustom, add KeyAlgorithm
+            IDLs and headers.
+
+        * crypto/CryptoKey.cpp:
+        * crypto/CryptoKey.h:
+        * crypto/CryptoKey.idl:
+        
+            Replace custom algorithm attribute with a union of the supported key algorithms.
+        
+        * crypto/keys/CryptoAesKeyAlgorithm.h: Added.
+        * crypto/keys/CryptoAesKeyAlgorithm.idl: Added.
+        * crypto/keys/CryptoEcKeyAlgorithm.h: Added.
+        * crypto/keys/CryptoEcKeyAlgorithm.idl: Added.
+        * crypto/keys/CryptoHmacKeyAlgorithm.h: Added.
+        * crypto/keys/CryptoHmacKeyAlgorithm.idl: Added.
+        * crypto/keys/CryptoKeyAlgorithm.h: Added.
+        * crypto/keys/CryptoKeyAlgorithm.idl: Added.
+        * crypto/keys/CryptoRsaHashedKeyAlgorithm.h: Added.
+        * crypto/keys/CryptoRsaHashedKeyAlgorithm.idl: Added.
+        * crypto/keys/CryptoRsaKeyAlgorithm.h: Added.
+        * crypto/keys/CryptoRsaKeyAlgorithm.idl: Added.
+
+            Add IDLs and headers fo the supported key algorithms.
+
+        * crypto/keys/CryptoKeyAES.h:
+        * crypto/keys/CryptoKeyEC.h:
+        * crypto/keys/CryptoKeyHMAC.h:
+        * crypto/keys/CryptoKeyRSA.h:
+        * crypto/keys/CryptoKeyRaw.h:
+
+            Give each of the existing KeyAlgorithm subclasses a dictionary() function
+            that returns the populated corresponding spec'd dictionary.
+
 2017-08-11  Simon Fraser  <simon.fraser@apple.com>
 
         Some RenderSVGResource cleanup
index 8d564e6770bfd8442d578d54c2b981fb85e1b7f8..a19eb928589cf31ea19e62457c81cd23ed6ea549 100644 (file)
@@ -56,6 +56,7 @@ VPATH = \
     $(WebCore)/animation \
     $(WebCore)/bindings/js \
     $(WebCore)/crypto \
+    $(WebCore)/crypto/keys \
     $(WebCore)/crypto/parameters \
     $(WebCore)/css \
     $(WebCore)/dom \
@@ -305,6 +306,12 @@ JS_BINDING_IDLS = \
     $(WebCore)/crypto/RsaOtherPrimesInfo.idl \
     $(WebCore)/crypto/SubtleCrypto.idl \
     $(WebCore)/crypto/WebKitSubtleCrypto.idl \
+    $(WebCore)/crypto/keys/CryptoAesKeyAlgorithm.idl \
+    $(WebCore)/crypto/keys/CryptoEcKeyAlgorithm.idl \
+    $(WebCore)/crypto/keys/CryptoHmacKeyAlgorithm.idl \
+    $(WebCore)/crypto/keys/CryptoKeyAlgorithm.idl \
+    $(WebCore)/crypto/keys/CryptoRsaHashedKeyAlgorithm.idl \
+    $(WebCore)/crypto/keys/CryptoRsaKeyAlgorithm.idl \
     $(WebCore)/crypto/parameters/AesCbcCfbParams.idl \
     $(WebCore)/crypto/parameters/AesCtrParams.idl \
     $(WebCore)/crypto/parameters/AesGcmParams.idl \
index 8aa57aded53af994d9ba67b9471e5b2c9a8774b3..14d4e8b4cc2f5fc9e427a35070f43cc5e99d2e5f 100644 (file)
                7C93F34A1AA6BA5E00A98BAB /* CompiledContentExtension.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C93F3481AA6BA5E00A98BAB /* CompiledContentExtension.h */; settings = {ATTRIBUTES = (Private, ); }; };
                7C93F34D1AA6BF0700A98BAB /* ContentExtensionCompiler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C93F34B1AA6BF0700A98BAB /* ContentExtensionCompiler.cpp */; };
                7C93F34E1AA6BF0700A98BAB /* ContentExtensionCompiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C93F34C1AA6BF0700A98BAB /* ContentExtensionCompiler.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               7C9ACA921F3CC0AA00F3AA09 /* CryptoKeyAlgorithm.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C9ACA8F1F3CC0AA00F3AA09 /* CryptoKeyAlgorithm.h */; };
+               7C9ACA981F3CCDAD00F3AA09 /* CryptoAesKeyAlgorithm.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C9ACA961F3CCDAD00F3AA09 /* CryptoAesKeyAlgorithm.h */; };
+               7C9ACA9C1F3CCDF200F3AA09 /* CryptoEcKeyAlgorithm.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C9ACA9A1F3CCDF200F3AA09 /* CryptoEcKeyAlgorithm.h */; };
+               7C9ACAA01F3CCE3000F3AA09 /* CryptoHmacKeyAlgorithm.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C9ACA9E1F3CCE3000F3AA09 /* CryptoHmacKeyAlgorithm.h */; };
+               7C9ACAA41F3CCE6900F3AA09 /* CryptoRsaKeyAlgorithm.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C9ACAA21F3CCE6900F3AA09 /* CryptoRsaKeyAlgorithm.h */; };
+               7C9ACAA81F3CCEB400F3AA09 /* CryptoRsaHashedKeyAlgorithm.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C9ACAA61F3CCEB400F3AA09 /* CryptoRsaHashedKeyAlgorithm.h */; };
+               7C9ACAB71F3CF1AE00F3AA09 /* JSCryptoAesKeyAlgorithm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C9ACAB61F3CDC4700F3AA09 /* JSCryptoAesKeyAlgorithm.cpp */; };
+               7C9ACAB81F3CF1AE00F3AA09 /* JSCryptoAesKeyAlgorithm.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C9ACAAA1F3CDB6300F3AA09 /* JSCryptoAesKeyAlgorithm.h */; };
+               7C9ACAB91F3CF1AE00F3AA09 /* JSCryptoEcKeyAlgorithm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C9ACAAD1F3CDB9E00F3AA09 /* JSCryptoEcKeyAlgorithm.cpp */; };
+               7C9ACABA1F3CF1AE00F3AA09 /* JSCryptoEcKeyAlgorithm.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C9ACAAC1F3CDB9D00F3AA09 /* JSCryptoEcKeyAlgorithm.h */; };
+               7C9ACABB1F3CF1AE00F3AA09 /* JSCryptoHmacKeyAlgorithm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C9ACAAE1F3CDB9F00F3AA09 /* JSCryptoHmacKeyAlgorithm.cpp */; };
+               7C9ACABC1F3CF1AE00F3AA09 /* JSCryptoHmacKeyAlgorithm.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C9ACAAF1F3CDB9F00F3AA09 /* JSCryptoHmacKeyAlgorithm.h */; };
+               7C9ACABD1F3CF1AE00F3AA09 /* JSCryptoKeyAlgorithm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C9ACAB01F3CDBA000F3AA09 /* JSCryptoKeyAlgorithm.cpp */; };
+               7C9ACABE1F3CF1AF00F3AA09 /* JSCryptoKeyAlgorithm.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C9ACAB11F3CDBA100F3AA09 /* JSCryptoKeyAlgorithm.h */; };
+               7C9ACABF1F3CF1AF00F3AA09 /* JSCryptoRsaHashedKeyAlgorithm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C9ACAB41F3CDC0100F3AA09 /* JSCryptoRsaHashedKeyAlgorithm.cpp */; };
+               7C9ACAC01F3CF1AF00F3AA09 /* JSCryptoRsaHashedKeyAlgorithm.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C9ACAB51F3CDC0200F3AA09 /* JSCryptoRsaHashedKeyAlgorithm.h */; };
+               7C9ACAC11F3CF1AF00F3AA09 /* JSCryptoRsaKeyAlgorithm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C9ACAB21F3CDC0000F3AA09 /* JSCryptoRsaKeyAlgorithm.cpp */; };
+               7C9ACAC21F3CF1AF00F3AA09 /* JSCryptoRsaKeyAlgorithm.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C9ACAB31F3CDC0100F3AA09 /* JSCryptoRsaKeyAlgorithm.h */; };
                7C9DBFED1A9C49B1000D6B25 /* JSHTMLAttachmentElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C9DBFEB1A9C49B1000D6B25 /* JSHTMLAttachmentElement.cpp */; };
                7C9DBFEE1A9C49B1000D6B25 /* JSHTMLAttachmentElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C9DBFEC1A9C49B1000D6B25 /* JSHTMLAttachmentElement.h */; };
                7CB5CA3F1E525C7100FAEF13 /* MediaQueryExpression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CB5CA3D1E525C6C00FAEF13 /* MediaQueryExpression.cpp */; };
                E157A8E11817331C009F821D /* JSCryptoKey.h in Headers */ = {isa = PBXBuildFile; fileRef = E157A8DF1817331C009F821D /* JSCryptoKey.h */; };
                E157A8E418173A3A009F821D /* CryptoKey.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E157A8E218173A3A009F821D /* CryptoKey.cpp */; };
                E157A8E518173A3A009F821D /* CryptoKey.h in Headers */ = {isa = PBXBuildFile; fileRef = E157A8E318173A3A009F821D /* CryptoKey.h */; };
-               E157A8E818184C67009F821D /* JSCryptoKeyCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E157A8E618184C67009F821D /* JSCryptoKeyCustom.cpp */; };
-               E157A8F018185425009F821D /* JSCryptoAlgorithmBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E157A8EE18185425009F821D /* JSCryptoAlgorithmBuilder.cpp */; };
-               E157A8F118185425009F821D /* JSCryptoAlgorithmBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = E157A8EF18185425009F821D /* JSCryptoAlgorithmBuilder.h */; };
                E15A36D71104572000B7B639 /* XMLNSNames.h in Headers */ = {isa = PBXBuildFile; fileRef = E15A36D61104572000B7B639 /* XMLNSNames.h */; };
                E15A36D91104572700B7B639 /* XMLNSNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E15A36D81104572700B7B639 /* XMLNSNames.cpp */; };
                E15FF7D518C9553800FE4C87 /* KeypressCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = E15FF7D418C9553800FE4C87 /* KeypressCommand.h */; settings = {ATTRIBUTES = (Private, ); }; };
                7C93F3481AA6BA5E00A98BAB /* CompiledContentExtension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CompiledContentExtension.h; sourceTree = "<group>"; };
                7C93F34B1AA6BF0700A98BAB /* ContentExtensionCompiler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ContentExtensionCompiler.cpp; sourceTree = "<group>"; };
                7C93F34C1AA6BF0700A98BAB /* ContentExtensionCompiler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContentExtensionCompiler.h; sourceTree = "<group>"; };
+               7C9ACA8F1F3CC0AA00F3AA09 /* CryptoKeyAlgorithm.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CryptoKeyAlgorithm.h; sourceTree = "<group>"; };
+               7C9ACA911F3CC0AA00F3AA09 /* CryptoKeyAlgorithm.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = CryptoKeyAlgorithm.idl; sourceTree = "<group>"; };
+               7C9ACA961F3CCDAD00F3AA09 /* CryptoAesKeyAlgorithm.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CryptoAesKeyAlgorithm.h; sourceTree = "<group>"; };
+               7C9ACA971F3CCDAD00F3AA09 /* CryptoAesKeyAlgorithm.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = CryptoAesKeyAlgorithm.idl; sourceTree = "<group>"; };
+               7C9ACA9A1F3CCDF200F3AA09 /* CryptoEcKeyAlgorithm.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CryptoEcKeyAlgorithm.h; sourceTree = "<group>"; };
+               7C9ACA9B1F3CCDF200F3AA09 /* CryptoEcKeyAlgorithm.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = CryptoEcKeyAlgorithm.idl; sourceTree = "<group>"; };
+               7C9ACA9E1F3CCE3000F3AA09 /* CryptoHmacKeyAlgorithm.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CryptoHmacKeyAlgorithm.h; sourceTree = "<group>"; };
+               7C9ACA9F1F3CCE3000F3AA09 /* CryptoHmacKeyAlgorithm.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = CryptoHmacKeyAlgorithm.idl; sourceTree = "<group>"; };
+               7C9ACAA21F3CCE6900F3AA09 /* CryptoRsaKeyAlgorithm.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CryptoRsaKeyAlgorithm.h; sourceTree = "<group>"; };
+               7C9ACAA31F3CCE6900F3AA09 /* CryptoRsaKeyAlgorithm.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = CryptoRsaKeyAlgorithm.idl; sourceTree = "<group>"; };
+               7C9ACAA61F3CCEB400F3AA09 /* CryptoRsaHashedKeyAlgorithm.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CryptoRsaHashedKeyAlgorithm.h; sourceTree = "<group>"; };
+               7C9ACAA71F3CCEB400F3AA09 /* CryptoRsaHashedKeyAlgorithm.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = CryptoRsaHashedKeyAlgorithm.idl; sourceTree = "<group>"; };
+               7C9ACAAA1F3CDB6300F3AA09 /* JSCryptoAesKeyAlgorithm.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSCryptoAesKeyAlgorithm.h; sourceTree = "<group>"; };
+               7C9ACAAC1F3CDB9D00F3AA09 /* JSCryptoEcKeyAlgorithm.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSCryptoEcKeyAlgorithm.h; sourceTree = "<group>"; };
+               7C9ACAAD1F3CDB9E00F3AA09 /* JSCryptoEcKeyAlgorithm.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSCryptoEcKeyAlgorithm.cpp; sourceTree = "<group>"; };
+               7C9ACAAE1F3CDB9F00F3AA09 /* JSCryptoHmacKeyAlgorithm.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSCryptoHmacKeyAlgorithm.cpp; sourceTree = "<group>"; };
+               7C9ACAAF1F3CDB9F00F3AA09 /* JSCryptoHmacKeyAlgorithm.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSCryptoHmacKeyAlgorithm.h; sourceTree = "<group>"; };
+               7C9ACAB01F3CDBA000F3AA09 /* JSCryptoKeyAlgorithm.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSCryptoKeyAlgorithm.cpp; sourceTree = "<group>"; };
+               7C9ACAB11F3CDBA100F3AA09 /* JSCryptoKeyAlgorithm.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSCryptoKeyAlgorithm.h; sourceTree = "<group>"; };
+               7C9ACAB21F3CDC0000F3AA09 /* JSCryptoRsaKeyAlgorithm.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSCryptoRsaKeyAlgorithm.cpp; sourceTree = "<group>"; };
+               7C9ACAB31F3CDC0100F3AA09 /* JSCryptoRsaKeyAlgorithm.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSCryptoRsaKeyAlgorithm.h; sourceTree = "<group>"; };
+               7C9ACAB41F3CDC0100F3AA09 /* JSCryptoRsaHashedKeyAlgorithm.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSCryptoRsaHashedKeyAlgorithm.cpp; sourceTree = "<group>"; };
+               7C9ACAB51F3CDC0200F3AA09 /* JSCryptoRsaHashedKeyAlgorithm.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSCryptoRsaHashedKeyAlgorithm.h; sourceTree = "<group>"; };
+               7C9ACAB61F3CDC4700F3AA09 /* JSCryptoAesKeyAlgorithm.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSCryptoAesKeyAlgorithm.cpp; sourceTree = "<group>"; };
                7C9DBFEA1A9C489F000D6B25 /* HTMLAttachmentElement.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = HTMLAttachmentElement.idl; sourceTree = "<group>"; };
                7C9DBFEB1A9C49B1000D6B25 /* JSHTMLAttachmentElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLAttachmentElement.cpp; sourceTree = "<group>"; };
                7C9DBFEC1A9C49B1000D6B25 /* JSHTMLAttachmentElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSHTMLAttachmentElement.h; sourceTree = "<group>"; };
                E157A8DF1817331C009F821D /* JSCryptoKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCryptoKey.h; sourceTree = "<group>"; };
                E157A8E218173A3A009F821D /* CryptoKey.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoKey.cpp; sourceTree = "<group>"; };
                E157A8E318173A3A009F821D /* CryptoKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoKey.h; sourceTree = "<group>"; };
-               E157A8E618184C67009F821D /* JSCryptoKeyCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCryptoKeyCustom.cpp; sourceTree = "<group>"; };
-               E157A8EE18185425009F821D /* JSCryptoAlgorithmBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCryptoAlgorithmBuilder.cpp; sourceTree = "<group>"; };
-               E157A8EF18185425009F821D /* JSCryptoAlgorithmBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCryptoAlgorithmBuilder.h; sourceTree = "<group>"; };
                E15A36D61104572000B7B639 /* XMLNSNames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLNSNames.h; sourceTree = "<group>"; };
                E15A36D81104572700B7B639 /* XMLNSNames.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XMLNSNames.cpp; sourceTree = "<group>"; };
                E15FF7D418C9553800FE4C87 /* KeypressCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeypressCommand.h; sourceTree = "<group>"; };
                                5182C2521F3142500059BA7C /* JSServiceWorker.h */,
                                5182C2511F3142500059BA7C /* JSServiceWorkerContainer.cpp */,
                                5182C2541F3142500059BA7C /* JSServiceWorkerContainer.h */,
-                               51F175001F358B3600C74950 /* JSServiceWorkerUpdateViaCache.cpp */,
-                               51F175011F358B3600C74950 /* JSServiceWorkerUpdateViaCache.h */,
                                5182C24E1F3142500059BA7C /* JSServiceWorkerGlobalScope.cpp */,
                                5182C24D1F3142500059BA7C /* JSServiceWorkerGlobalScope.h */,
                                5182C24F1F3142500059BA7C /* JSServiceWorkerRegistration.cpp */,
                                5182C2501F3142500059BA7C /* JSServiceWorkerRegistration.h */,
+                               51F175001F358B3600C74950 /* JSServiceWorkerUpdateViaCache.cpp */,
+                               51F175011F358B3600C74950 /* JSServiceWorkerUpdateViaCache.h */,
                        );
                        name = ServiceWorkers;
                        path = DerivedSources;
                                1432E8460C51493800B1500F /* GCController.h */,
                                C585A66011D4FAC5004C3E4B /* IDBBindingUtilities.cpp */,
                                C585A66111D4FAC5004C3E4B /* IDBBindingUtilities.h */,
-                               E157A8EE18185425009F821D /* JSCryptoAlgorithmBuilder.cpp */,
-                               E157A8EF18185425009F821D /* JSCryptoAlgorithmBuilder.h */,
                                E1C657101815F9DD00256CDD /* JSCryptoAlgorithmDictionary.cpp */,
                                E1C657111815F9DD00256CDD /* JSCryptoAlgorithmDictionary.h */,
                                E125F84F18283A5600D84CD9 /* JSCryptoKeySerializationJWK.cpp */,
                        children = (
                                7CD3441B1F32DE30000DCD49 /* Cached Attributes w/ Invalidation */,
                                7C3D8EE41E08BABE0023B084 /* GC / Wrapping Only */,
-                               E157A8E618184C67009F821D /* JSCryptoKeyCustom.cpp */,
                                9BC5F9DF1D5AAF6A002B749D /* JSCustomElementRegistryCustom.cpp */,
                                BCD9C25E0C17AA67005C90A2 /* JSDOMWindowCustom.cpp */,
                                652FBBBB0DE27CB60001D386 /* JSDOMWindowCustom.h */,
                E19DA29D181995CE00088BC8 /* keys */ = {
                        isa = PBXGroup;
                        children = (
+                               7C9ACA961F3CCDAD00F3AA09 /* CryptoAesKeyAlgorithm.h */,
+                               7C9ACA971F3CCDAD00F3AA09 /* CryptoAesKeyAlgorithm.idl */,
+                               7C9ACA9A1F3CCDF200F3AA09 /* CryptoEcKeyAlgorithm.h */,
+                               7C9ACA9B1F3CCDF200F3AA09 /* CryptoEcKeyAlgorithm.idl */,
+                               7C9ACA9E1F3CCE3000F3AA09 /* CryptoHmacKeyAlgorithm.h */,
+                               7C9ACA9F1F3CCE3000F3AA09 /* CryptoHmacKeyAlgorithm.idl */,
                                E125F84B1824289D00D84CD9 /* CryptoKeyAES.cpp */,
                                E125F84C1824289D00D84CD9 /* CryptoKeyAES.h */,
+                               7C9ACA8F1F3CC0AA00F3AA09 /* CryptoKeyAlgorithm.h */,
+                               7C9ACA911F3CC0AA00F3AA09 /* CryptoKeyAlgorithm.idl */,
                                E125F861182C303A00D84CD9 /* CryptoKeyDataOctetSequence.cpp */,
                                E125F862182C303A00D84CD9 /* CryptoKeyDataOctetSequence.h */,
                                E1C266DC18319F31003F8B33 /* CryptoKeyDataRSAComponents.cpp */,
                                E164FAA218315BF400DB4E61 /* CryptoKeyRSA.h */,
                                E125F857182C1AA600D84CD9 /* CryptoKeySerializationRaw.cpp */,
                                E125F858182C1AA600D84CD9 /* CryptoKeySerializationRaw.h */,
+                               7C9ACAA61F3CCEB400F3AA09 /* CryptoRsaHashedKeyAlgorithm.h */,
+                               7C9ACAA71F3CCEB400F3AA09 /* CryptoRsaHashedKeyAlgorithm.idl */,
+                               7C9ACAA21F3CCE6900F3AA09 /* CryptoRsaKeyAlgorithm.h */,
+                               7C9ACAA31F3CCE6900F3AA09 /* CryptoRsaKeyAlgorithm.idl */,
                        );
                        path = keys;
                        sourceTree = "<group>";
                                57B5F80B1E5D22DA00F34F90 /* JSAesGcmParams.h */,
                                576814421E70CB1000E77754 /* JSAesKeyParams.cpp */,
                                576814431E70CB1000E77754 /* JSAesKeyParams.h */,
+                               7C9ACAB61F3CDC4700F3AA09 /* JSCryptoAesKeyAlgorithm.cpp */,
+                               7C9ACAAA1F3CDB6300F3AA09 /* JSCryptoAesKeyAlgorithm.h */,
                                5739E1301DAC7FD100E14383 /* JSCryptoAlgorithmParameters.cpp */,
                                5739E12E1DAC7F7800E14383 /* JSCryptoAlgorithmParameters.h */,
+                               7C9ACAAD1F3CDB9E00F3AA09 /* JSCryptoEcKeyAlgorithm.cpp */,
+                               7C9ACAAC1F3CDB9D00F3AA09 /* JSCryptoEcKeyAlgorithm.h */,
+                               7C9ACAAE1F3CDB9F00F3AA09 /* JSCryptoHmacKeyAlgorithm.cpp */,
+                               7C9ACAAF1F3CDB9F00F3AA09 /* JSCryptoHmacKeyAlgorithm.h */,
                                E157A8DE1817331C009F821D /* JSCryptoKey.cpp */,
                                E157A8DF1817331C009F821D /* JSCryptoKey.h */,
+                               7C9ACAB01F3CDBA000F3AA09 /* JSCryptoKeyAlgorithm.cpp */,
+                               7C9ACAB11F3CDBA100F3AA09 /* JSCryptoKeyAlgorithm.h */,
                                E1F80B8B183172B5007885C3 /* JSCryptoKeyPair.cpp */,
                                E1F80B8C183172B5007885C3 /* JSCryptoKeyPair.h */,
                                57D0018E1DD5415300ED19D9 /* JSCryptoKeyUsage.cpp */,
                                57D0018C1DD5413200ED19D9 /* JSCryptoKeyUsage.h */,
+                               7C9ACAB41F3CDC0100F3AA09 /* JSCryptoRsaHashedKeyAlgorithm.cpp */,
+                               7C9ACAB51F3CDC0200F3AA09 /* JSCryptoRsaHashedKeyAlgorithm.h */,
+                               7C9ACAB21F3CDC0000F3AA09 /* JSCryptoRsaKeyAlgorithm.cpp */,
+                               7C9ACAB31F3CDC0100F3AA09 /* JSCryptoRsaKeyAlgorithm.h */,
                                5768143D1E709C3600E77754 /* JSEcdhKeyDeriveParams.cpp */,
                                5768143E1E709C3600E77754 /* JSEcdhKeyDeriveParams.h */,
                                57EEAA521EA001B100701124 /* JSEcdsaParams.cpp */,
                                E1C415DA0F655D6F0092D2FB /* CrossOriginPreflightResultCache.h in Headers */,
                                E169803D1133542D00894115 /* CRuntimeObject.h in Headers */,
                                975CA28B130365F800E99AD9 /* Crypto.h in Headers */,
+                               7C9ACA981F3CCDAD00F3AA09 /* CryptoAesKeyAlgorithm.h in Headers */,
                                E172AF6E180F24C600FBADB9 /* CryptoAlgorithm.h in Headers */,
                                E125F8421824253A00D84CD9 /* CryptoAlgorithmAES_CBC.h in Headers */,
                                571252691E524EB1008FF369 /* CryptoAlgorithmAES_CFB.h in Headers */,
                                E19AC3F31824DC7900349426 /* CryptoAlgorithmSHA384.h in Headers */,
                                E19AC3F51824DC7900349426 /* CryptoAlgorithmSHA512.h in Headers */,
                                5721A9871ECE53B10081295A /* CryptoDigestAlgorithm.h in Headers */,
+                               7C9ACA9C1F3CCDF200F3AA09 /* CryptoEcKeyAlgorithm.h in Headers */,
+                               7C9ACAA01F3CCE3000F3AA09 /* CryptoHmacKeyAlgorithm.h in Headers */,
                                E157A8E518173A3A009F821D /* CryptoKey.h in Headers */,
                                E125F84E1824289D00D84CD9 /* CryptoKeyAES.h in Headers */,
+                               7C9ACA921F3CC0AA00F3AA09 /* CryptoKeyAlgorithm.h in Headers */,
                                E125F85E182C2DF600D84CD9 /* CryptoKeyData.h in Headers */,
                                E125F864182C303A00D84CD9 /* CryptoKeyDataOctetSequence.h in Headers */,
                                E1C266DF18319F31003F8B33 /* CryptoKeyDataRSAComponents.h in Headers */,
                                E125F85A182C1AA600D84CD9 /* CryptoKeySerializationRaw.h in Headers */,
                                E19727161820549E00592D51 /* CryptoKeyType.h in Headers */,
                                E172AF70180F289500FBADB9 /* CryptoKeyUsage.h in Headers */,
+                               7C9ACAA81F3CCEB400F3AA09 /* CryptoRsaHashedKeyAlgorithm.h in Headers */,
+                               7C9ACAA41F3CCE6900F3AA09 /* CryptoRsaKeyAlgorithm.h in Headers */,
                                316FE1140E6E1DA700BF6088 /* CSSAnimationController.h in Headers */,
                                0F15DA8A0F3AAEE70000CE47 /* CSSAnimationControllerPrivate.h in Headers */,
                                31BC742E1AAFF45C006B4340 /* CSSAnimationTriggerScrollValue.h in Headers */,
                                316BDBF71E762AD500DE0D5A /* GPUDepthStencilDescriptor.h in Headers */,
                                316BDBF01E76292000DE0D5A /* GPUDepthStencilState.h in Headers */,
                                316BDB861E6E0A2700DE0D5A /* GPUDevice.h in Headers */,
-                               51F174FE1F35899200C74950 /* WorkerType.h in Headers */,
                                316BDBCD1E75F18400DE0D5A /* GPUDrawable.h in Headers */,
                                316BDBFB1E762D0400DE0D5A /* GPUEnums.h in Headers */,
                                316BDB951E70C89700DE0D5A /* GPUFunction.h in Headers */,
                                A871D45C0A127CBC00B12A68 /* HTMLEmbedElement.h in Headers */,
                                977B386A122883E900B81FF8 /* HTMLEntityParser.h in Headers */,
                                977B386C122883E900B81FF8 /* HTMLEntitySearch.h in Headers */,
-                               51F174FF1F35899700C74950 /* ServiceWorkerUpdateViaCache.h in Headers */,
                                977B386D122883E900B81FF8 /* HTMLEntityTable.h in Headers */,
                                A81369D4097374F600D74463 /* HTMLFieldSetElement.h in Headers */,
                                A8CFF7A60A156978000A4234 /* HTMLFontElement.h in Headers */,
                                77D5101C1ED722BF00DA4C87 /* JSCredentialsContainer.h in Headers */,
                                77D510021ED4F71800DA4C87 /* JSCredentialUserData.h in Headers */,
                                975CA2A21303679D00E99AD9 /* JSCrypto.h in Headers */,
-                               E157A8F118185425009F821D /* JSCryptoAlgorithmBuilder.h in Headers */,
+                               7C9ACAB81F3CF1AE00F3AA09 /* JSCryptoAesKeyAlgorithm.h in Headers */,
                                E1C657131815F9DD00256CDD /* JSCryptoAlgorithmDictionary.h in Headers */,
                                5739E12F1DAC7F7800E14383 /* JSCryptoAlgorithmParameters.h in Headers */,
+                               7C9ACABA1F3CF1AE00F3AA09 /* JSCryptoEcKeyAlgorithm.h in Headers */,
+                               7C9ACABC1F3CF1AE00F3AA09 /* JSCryptoHmacKeyAlgorithm.h in Headers */,
                                E157A8E11817331C009F821D /* JSCryptoKey.h in Headers */,
+                               7C9ACABE1F3CF1AF00F3AA09 /* JSCryptoKeyAlgorithm.h in Headers */,
                                E1F80B8E183172B5007885C3 /* JSCryptoKeyPair.h in Headers */,
                                E125F85218283A5600D84CD9 /* JSCryptoKeySerializationJWK.h in Headers */,
                                57D0018D1DD5413200ED19D9 /* JSCryptoKeyUsage.h in Headers */,
                                E125F83E182411E700D84CD9 /* JSCryptoOperationData.h in Headers */,
+                               7C9ACAC01F3CF1AF00F3AA09 /* JSCryptoRsaHashedKeyAlgorithm.h in Headers */,
+                               7C9ACAC21F3CF1AF00F3AA09 /* JSCryptoRsaKeyAlgorithm.h in Headers */,
                                BC46C1FD0C0DDC8F0020CFC3 /* JSCSSFontFaceRule.h in Headers */,
                                BC46C1FF0C0DDC8F0020CFC3 /* JSCSSImportRule.h in Headers */,
                                316FE0720E6CCBEE00BF6088 /* JSCSSKeyframeRule.h in Headers */,
                                5182C2581F3143CD0059BA7C /* JSServiceWorkerContainer.h in Headers */,
                                5182C25A1F3143CD0059BA7C /* JSServiceWorkerGlobalScope.h in Headers */,
                                5182C25C1F3143CD0059BA7C /* JSServiceWorkerRegistration.h in Headers */,
+                               51F175031F358B3B00C74950 /* JSServiceWorkerUpdateViaCache.h in Headers */,
                                9BDA64D81B975CF2009C4387 /* JSShadowRoot.h in Headers */,
                                46DFF49C1DC2620B00B80B48 /* JSShadowRootMode.h in Headers */,
                                CD9DE17B17AAC75B00EA386D /* JSSourceBuffer.h in Headers */,
                                6E3FAD3914733F4000E42306 /* JSWebGLCompressedTextureS3TC.h in Headers */,
                                6EE8A77310F803F3005A4A24 /* JSWebGLContextAttributes.h in Headers */,
                                BC2CBF4E140F1ABD003879BE /* JSWebGLContextEvent.h in Headers */,
-                               51F175061F358BF700C74950 /* JSWorkerType.h in Headers */,
                                6E3FAD3914733F4011E42307 /* JSWebGLDebugRendererInfo.h in Headers */,
                                6E3FAD3914733F4022E42307 /* JSWebGLDebugShaders.h in Headers */,
                                6E3FAD3914733F4000E42307 /* JSWebGLDepthTexture.h in Headers */,
                                E1C36D350EB0A094007410BC /* JSWorkerGlobalScopeBase.h in Headers */,
                                E1C362EF0EAF2AA9007410BC /* JSWorkerLocation.h in Headers */,
                                E1271A580EEECDE400F61213 /* JSWorkerNavigator.h in Headers */,
+                               51F175061F358BF700C74950 /* JSWorkerType.h in Headers */,
                                7C4C96DD1AD4483500365A60 /* JSWritableStream.h in Headers */,
                                8358CB701C53277500E0C2D8 /* JSXMLDocument.h in Headers */,
                                BC348BD40DB7F804004ABAB9 /* JSXMLHttpRequest.h in Headers */,
                                413E00791DB0E4F2002341D2 /* MemoryRelease.h in Headers */,
                                93309DFA099E64920056E581 /* MergeIdenticalElementsCommand.h in Headers */,
                                E1ADECCE0E76AD8B004A1A5E /* MessageChannel.h in Headers */,
-                               51F175031F358B3B00C74950 /* JSServiceWorkerUpdateViaCache.h in Headers */,
                                75793E840D0CE0B3007FC0AC /* MessageEvent.h in Headers */,
                                E1ADECBF0E76ACF1004A1A5E /* MessagePort.h in Headers */,
                                41BF700C0FE86F49005E8DEC /* MessagePortChannel.h in Headers */,
                                5182C2411F313A090059BA7C /* ServiceWorkerContainer.h in Headers */,
                                5182C2431F313A090059BA7C /* ServiceWorkerGlobalScope.h in Headers */,
                                5182C2451F313A090059BA7C /* ServiceWorkerRegistration.h in Headers */,
+                               51F174FF1F35899700C74950 /* ServiceWorkerUpdateViaCache.h in Headers */,
                                756B2CE118B7101600FECFAA /* SessionID.h in Headers */,
                                93309E10099E64920056E581 /* SetNodeAttributeCommand.h in Headers */,
                                B8DBDB4C130B0F8A00F5CDB1 /* SetSelectionCommand.h in Headers */,
                                0B9056F90F2685F30095FF6A /* WorkerThreadableLoader.h in Headers */,
                                97AABD2D14FA09D5007457AE /* WorkerThreadableWebSocketChannel.h in Headers */,
                                A54A0C681DB807D90017A90B /* WorkerToPageFrontendChannel.h in Headers */,
+                               51F174FE1F35899200C74950 /* WorkerType.h in Headers */,
                                93309E24099E64920056E581 /* WrapContentsInDummySpanCommand.h in Headers */,
                                416E6FE91BBD12E5000A6053 /* WritableStreamBuiltins.h in Headers */,
                                416E6FE81BBD12DF000A6053 /* WritableStreamInternalsBuiltins.h in Headers */,
                                77D5101D1ED722C300DA4C87 /* JSCredentialsContainer.cpp in Sources */,
                                77D510031ED4F71B00DA4C87 /* JSCredentialUserData.cpp in Sources */,
                                975CA2A11303679D00E99AD9 /* JSCrypto.cpp in Sources */,
-                               E157A8F018185425009F821D /* JSCryptoAlgorithmBuilder.cpp in Sources */,
+                               7C9ACAB71F3CF1AE00F3AA09 /* JSCryptoAesKeyAlgorithm.cpp in Sources */,
                                E1C657121815F9DD00256CDD /* JSCryptoAlgorithmDictionary.cpp in Sources */,
                                5739E1311DAC7FD100E14383 /* JSCryptoAlgorithmParameters.cpp in Sources */,
+                               7C9ACAB91F3CF1AE00F3AA09 /* JSCryptoEcKeyAlgorithm.cpp in Sources */,
+                               7C9ACABB1F3CF1AE00F3AA09 /* JSCryptoHmacKeyAlgorithm.cpp in Sources */,
                                E157A8E01817331C009F821D /* JSCryptoKey.cpp in Sources */,
-                               E157A8E818184C67009F821D /* JSCryptoKeyCustom.cpp in Sources */,
+                               7C9ACABD1F3CF1AE00F3AA09 /* JSCryptoKeyAlgorithm.cpp in Sources */,
                                E1F80B8D183172B5007885C3 /* JSCryptoKeyPair.cpp in Sources */,
                                E125F85118283A5600D84CD9 /* JSCryptoKeySerializationJWK.cpp in Sources */,
                                57D0018F1DD5415300ED19D9 /* JSCryptoKeyUsage.cpp in Sources */,
                                E125F83D182411E700D84CD9 /* JSCryptoOperationData.cpp in Sources */,
+                               7C9ACABF1F3CF1AF00F3AA09 /* JSCryptoRsaHashedKeyAlgorithm.cpp in Sources */,
+                               7C9ACAC11F3CF1AF00F3AA09 /* JSCryptoRsaKeyAlgorithm.cpp in Sources */,
                                BC46C1FC0C0DDC8F0020CFC3 /* JSCSSFontFaceRule.cpp in Sources */,
                                BC46C1FE0C0DDC8F0020CFC3 /* JSCSSImportRule.cpp in Sources */,
                                316FE0710E6CCBEE00BF6088 /* JSCSSKeyframeRule.cpp in Sources */,
                                12A253E01C8FFF6600C22295 /* JSKeyframeEffect.cpp in Sources */,
                                935F45420F7C3B5F00D7C1FB /* JSLazyEventListener.cpp in Sources */,
                                BCE1C43B0D9830D3003B02F2 /* JSLocation.cpp in Sources */,
-                               51F175071F358BF900C74950 /* JSWorkerType.cpp in Sources */,
                                BCE1C4400D9830F4003B02F2 /* JSLocationCustom.cpp in Sources */,
                                93A8061F1E03B585008A1F26 /* JSLongRange.cpp in Sources */,
                                8FAC774D119872CB0015AE94 /* JSMainThreadExecState.cpp in Sources */,
                                5182C2571F3143CD0059BA7C /* JSServiceWorkerContainer.cpp in Sources */,
                                5182C2591F3143CD0059BA7C /* JSServiceWorkerGlobalScope.cpp in Sources */,
                                5182C25B1F3143CD0059BA7C /* JSServiceWorkerRegistration.cpp in Sources */,
+                               51F175021F358B3B00C74950 /* JSServiceWorkerUpdateViaCache.cpp in Sources */,
                                9BDA64D71B975CE5009C4387 /* JSShadowRoot.cpp in Sources */,
                                46DFF49B1DC2620B00B80B48 /* JSShadowRootMode.cpp in Sources */,
                                CD9DE17A17AAC75B00EA386D /* JSSourceBuffer.cpp in Sources */,
                                E18258AC0EF3CD7000933242 /* JSWorkerGlobalScopeCustom.cpp in Sources */,
                                E1C362F00EAF2AA9007410BC /* JSWorkerLocation.cpp in Sources */,
                                E1271A590EEECDE400F61213 /* JSWorkerNavigator.cpp in Sources */,
+                               51F175071F358BF900C74950 /* JSWorkerType.cpp in Sources */,
                                7C4C96DC1AD4483500365A60 /* JSWritableStream.cpp in Sources */,
                                8358CB6F1C53277200E0C2D8 /* JSXMLDocument.cpp in Sources */,
                                83A4A9F91CE7FD8100709B00 /* JSXMLDocumentCustom.cpp in Sources */,
                                7AF9B20218CFB2DF00C64BEF /* VTTRegion.cpp in Sources */,
                                7AF9B20518CFB2DF00C64BEF /* VTTRegionList.cpp in Sources */,
                                7A93868518DCC14500B8263D /* VTTScanner.cpp in Sources */,
-                               51F175021F358B3B00C74950 /* JSServiceWorkerUpdateViaCache.cpp in Sources */,
                                A14832B1187F61E100DA63A6 /* WAKAppKitStubs.m in Sources */,
                                A14832B3187F629100DA63A6 /* WAKClipView.m in Sources */,
                                A14832B5187F62FC00DA63A6 /* WAKResponder.m in Sources */,
diff --git a/Source/WebCore/bindings/js/JSCryptoAlgorithmBuilder.cpp b/Source/WebCore/bindings/js/JSCryptoAlgorithmBuilder.cpp
deleted file mode 100644 (file)
index d99c27a..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "JSCryptoAlgorithmBuilder.h"
-
-#if ENABLE(SUBTLE_CRYPTO)
-
-#include <runtime/JSCInlines.h>
-#include <runtime/ObjectConstructor.h>
-#include <runtime/TypedArrays.h>
-#include <runtime/TypedArrayInlines.h>
-#include <runtime/VMEntryScope.h>
-
-using namespace JSC;
-
-namespace WebCore {
-
-JSCryptoAlgorithmBuilder::JSCryptoAlgorithmBuilder(ExecState* exec)
-    : m_exec(exec)
-    , m_dictionary(constructEmptyObject(exec))
-{
-}
-
-JSCryptoAlgorithmBuilder::~JSCryptoAlgorithmBuilder()
-{
-}
-
-void JSCryptoAlgorithmBuilder::add(const char* key, unsigned value)
-{
-    VM& vm = m_exec->vm();
-    Identifier identifier = Identifier::fromString(&vm, key);
-    m_dictionary->putDirect(vm, identifier, jsNumber(value));
-}
-
-void JSCryptoAlgorithmBuilder::add(const char* key, const String& value)
-{
-    VM& vm = m_exec->vm();
-    Identifier identifier = Identifier::fromString(&vm, key);
-    m_dictionary->putDirect(vm, identifier, jsString(m_exec, value));
-}
-
-void JSCryptoAlgorithmBuilder::add(const char* key, const Vector<uint8_t>& buffer)
-{
-    VM& vm = m_exec->vm();
-    Identifier identifier = Identifier::fromString(&vm, key);
-    RefPtr<Uint8Array> arrayView = Uint8Array::create(buffer.data(), buffer.size());
-    m_dictionary->putDirect(vm, identifier, arrayView->wrap(m_exec, vm.entryScope->globalObject()));
-}
-
-void JSCryptoAlgorithmBuilder::add(const char* key, const JSCryptoAlgorithmBuilder& nestedBuilder)
-{
-    VM& vm = m_exec->vm();
-    Identifier identifier = Identifier::fromString(&vm, key);
-    m_dictionary->putDirect(vm, identifier, nestedBuilder.result());
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(SUBTLE_CRYPTO)
diff --git a/Source/WebCore/bindings/js/JSCryptoKeyCustom.cpp b/Source/WebCore/bindings/js/JSCryptoKeyCustom.cpp
deleted file mode 100644 (file)
index 1912870..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "JSCryptoKey.h"
-
-#if ENABLE(SUBTLE_CRYPTO)
-
-#include "CryptoKeyAES.h"
-#include "CryptoKeyEC.h"
-#include "CryptoKeyHMAC.h"
-#include "CryptoKeyRSA.h"
-#include "CryptoKeyRaw.h"
-#include "JSCryptoAlgorithmBuilder.h"
-#include <heap/HeapInlines.h>
-#include <runtime/JSCJSValueInlines.h>
-
-using namespace JSC;
-
-namespace WebCore {
-
-JSValue JSCryptoKey::algorithm(JSC::ExecState& state) const
-{
-    if (m_algorithm)
-        return m_algorithm.get();
-
-    JSCryptoAlgorithmBuilder builder(&state);
-
-    std::unique_ptr<KeyAlgorithm> algorithm = wrapped().buildAlgorithm();
-    switch (algorithm->keyAlgorithmClass()) {
-    case KeyAlgorithmClass::AES: {
-        auto& aesAlgorithm = downcast<AesKeyAlgorithm>(*algorithm);
-        builder.add("name", aesAlgorithm.name());
-        builder.add("length", aesAlgorithm.length());
-        break;
-    }
-    case KeyAlgorithmClass::EC: {
-        auto& ecAlgorithm = downcast<EcKeyAlgorithm>(*algorithm);
-        builder.add("name", ecAlgorithm.name());
-        builder.add("namedCurve", ecAlgorithm.namedCurve());
-        break;
-    }
-    case KeyAlgorithmClass::HMAC: {
-        auto& hmacAlgorithm = downcast<HmacKeyAlgorithm>(*algorithm);
-        builder.add("name", hmacAlgorithm.name());
-        JSCryptoAlgorithmBuilder hmacHash(&state);
-        hmacHash.add("name", hmacAlgorithm.hash());
-        builder.add("hash", hmacHash);
-        builder.add("length", hmacAlgorithm.length());
-        break;
-    }
-    case KeyAlgorithmClass::HRSA: {
-        auto& rsaAlgorithm = downcast<RsaHashedKeyAlgorithm>(*algorithm);
-        builder.add("name", rsaAlgorithm.name());
-        builder.add("modulusLength", rsaAlgorithm.modulusLength());
-        builder.add("publicExponent", rsaAlgorithm.publicExponent());
-        JSCryptoAlgorithmBuilder rsaHash(&state);
-        rsaHash.add("name", rsaAlgorithm.hash());
-        builder.add("hash", rsaHash);
-        break;
-    }
-    case KeyAlgorithmClass::RSA: {
-        auto& rsaAlgorithm = downcast<RsaKeyAlgorithm>(*algorithm);
-        builder.add("name", rsaAlgorithm.name());
-        builder.add("modulusLength", rsaAlgorithm.modulusLength());
-        builder.add("publicExponent", rsaAlgorithm.publicExponent());
-        break;
-    }
-    case KeyAlgorithmClass::Raw: {
-        auto& rawAlgorithm = downcast<RawKeyAlgorithm>(*algorithm);
-        builder.add("name", rawAlgorithm.name());
-        break;
-    }
-    }
-
-    m_algorithm.set(state.vm(), this, builder.result());
-    return m_algorithm.get();
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(SUBTLE_CRYPTO)
index 6420e57bef8ccba1b38a0d76e0f1513941a3c120..9a17fa75172313fe3a18e9c02c0401275898e3ad 100644 (file)
 #if ENABLE(SUBTLE_CRYPTO)
 
 #include "CryptoAlgorithmRegistry.h"
+#include "CryptoKeyAES.h"
+#include "CryptoKeyEC.h"
+#include "CryptoKeyHMAC.h"
+#include "CryptoKeyRSA.h"
+#include "CryptoKeyRaw.h"
 #include <wtf/CryptographicallyRandomNumber.h>
 
 namespace WebCore {
@@ -45,6 +50,25 @@ CryptoKey::~CryptoKey()
 {
 }
 
+auto CryptoKey::algorithm() const -> AlgorithmVariant
+{
+    std::unique_ptr<KeyAlgorithm> algorithm = buildAlgorithm();
+    switch (algorithm->keyAlgorithmClass()) {
+    case KeyAlgorithmClass::AES:
+        return downcast<AesKeyAlgorithm>(*algorithm).dictionary();
+    case KeyAlgorithmClass::EC:
+        return downcast<EcKeyAlgorithm>(*algorithm).dictionary();
+    case KeyAlgorithmClass::HMAC:
+        return downcast<HmacKeyAlgorithm>(*algorithm).dictionary();
+    case KeyAlgorithmClass::HRSA:
+        return downcast<RsaHashedKeyAlgorithm>(*algorithm).dictionary();
+    case KeyAlgorithmClass::RSA:
+        return downcast<RsaKeyAlgorithm>(*algorithm).dictionary();
+    case KeyAlgorithmClass::Raw:
+        return downcast<RawKeyAlgorithm>(*algorithm).dictionary();
+    }
+}
+
 auto CryptoKey::usages() const -> Vector<CryptoKeyUsage>
 {
     // The result is ordered alphabetically.
index eec888e5fe1ccc1e7c148f5384fe7995a9e386a9..9a5bc80699cd7b2370434e040c0d38aebb54cbc9 100644 (file)
 
 #if ENABLE(SUBTLE_CRYPTO)
 
+#include "CryptoAesKeyAlgorithm.h"
 #include "CryptoAlgorithmIdentifier.h"
+#include "CryptoEcKeyAlgorithm.h"
+#include "CryptoHmacKeyAlgorithm.h"
+#include "CryptoKeyAlgorithm.h"
 #include "CryptoKeyType.h"
 #include "CryptoKeyUsage.h"
+#include "CryptoRsaHashedKeyAlgorithm.h"
+#include "CryptoRsaKeyAlgorithm.h"
 #include <wtf/Forward.h>
 #include <wtf/ThreadSafeRefCounted.h>
 #include <wtf/TypeCasts.h>
+#include <wtf/Variant.h>
 #include <wtf/Vector.h>
 #include <wtf/text/WTFString.h>
 
@@ -81,18 +88,19 @@ private:
 class CryptoKey : public ThreadSafeRefCounted<CryptoKey> {
 public:
     using Type = CryptoKeyType;
+    using AlgorithmVariant = Variant<CryptoKeyAlgorithm, CryptoAesKeyAlgorithm, CryptoEcKeyAlgorithm, CryptoHmacKeyAlgorithm, CryptoRsaHashedKeyAlgorithm, CryptoRsaKeyAlgorithm>;
+
     CryptoKey(CryptoAlgorithmIdentifier, Type, bool extractable, CryptoKeyUsageBitmap);
     virtual ~CryptoKey();
 
-    virtual CryptoKeyClass keyClass() const = 0;
-
     Type type() const;
     bool extractable() const { return m_extractable; }
-    virtual std::unique_ptr<KeyAlgorithm> buildAlgorithm() const = 0;
-
-    // Only for binding purpose.
+    AlgorithmVariant algorithm() const;
     Vector<CryptoKeyUsage> usages() const;
 
+    virtual CryptoKeyClass keyClass() const = 0;
+    virtual std::unique_ptr<KeyAlgorithm> buildAlgorithm() const = 0;
+
     CryptoAlgorithmIdentifier algorithmIdentifier() const { return m_algorithmIdentifier; }
     CryptoKeyUsageBitmap usagesBitmap() const { return m_usages; }
     void setUsagesBitmap(CryptoKeyUsageBitmap usage) { m_usages = usage; };
index 708a8d11d342e782c6a11d27da043f7a8d4b53c7..7ded78349f3c8a622da14d7d4e65e50461e23f33 100644 (file)
@@ -29,6 +29,8 @@ enum KeyType {
     "secret"
 };
 
+typedef (CryptoKeyAlgorithm or CryptoAesKeyAlgorithm or CryptoEcKeyAlgorithm or CryptoHmacKeyAlgorithm or CryptoRsaHashedKeyAlgorithm or CryptoRsaKeyAlgorithm) KeyAlgorithm;
+
 [
     Conditional=SUBTLE_CRYPTO,
     Exposed=(Window,Worker),
@@ -37,6 +39,6 @@ enum KeyType {
 ] interface CryptoKey {
     readonly attribute KeyType type;
     readonly attribute boolean extractable;
-    [CachedAttribute, CustomGetter] readonly attribute object algorithm;
+    [CachedAttribute] readonly attribute KeyAlgorithm algorithm;
     [CachedAttribute] readonly attribute sequence<CryptoKeyUsage> usages;
 };
diff --git a/Source/WebCore/crypto/keys/CryptoAesKeyAlgorithm.h b/Source/WebCore/crypto/keys/CryptoAesKeyAlgorithm.h
new file mode 100644 (file)
index 0000000..e2aa6cf
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "CryptoKeyAlgorithm.h"
+
+namespace WebCore {
+
+struct CryptoAesKeyAlgorithm : CryptoKeyAlgorithm {
+    // The length, in bits, of the key.
+    unsigned short length;
+};
+
+}
diff --git a/Source/WebCore/crypto/keys/CryptoAesKeyAlgorithm.idl b/Source/WebCore/crypto/keys/CryptoAesKeyAlgorithm.idl
new file mode 100644 (file)
index 0000000..e63af78
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    Conditional=SUBTLE_CRYPTO,
+    JSGenerateToJSObject
+] dictionary CryptoAesKeyAlgorithm : CryptoKeyAlgorithm {
+    // The length, in bits, of the key.
+    required unsigned short length;
+};
diff --git a/Source/WebCore/crypto/keys/CryptoEcKeyAlgorithm.h b/Source/WebCore/crypto/keys/CryptoEcKeyAlgorithm.h
new file mode 100644 (file)
index 0000000..dc6e676
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "CryptoKeyAlgorithm.h"
+
+namespace WebCore {
+
+struct CryptoEcKeyAlgorithm : CryptoKeyAlgorithm {
+    // The named curve that the key uses
+    String namedCurve;
+};
+
+}
+
diff --git a/Source/WebCore/crypto/keys/CryptoEcKeyAlgorithm.idl b/Source/WebCore/crypto/keys/CryptoEcKeyAlgorithm.idl
new file mode 100644 (file)
index 0000000..c729c0c
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+typedef DOMString NamedCurve;
+
+[
+    Conditional=SUBTLE_CRYPTO,
+    JSGenerateToJSObject
+] dictionary CryptoEcKeyAlgorithm : CryptoKeyAlgorithm {
+    // The named curve that the key uses
+    required NamedCurve namedCurve;
+};
diff --git a/Source/WebCore/crypto/keys/CryptoHmacKeyAlgorithm.h b/Source/WebCore/crypto/keys/CryptoHmacKeyAlgorithm.h
new file mode 100644 (file)
index 0000000..92aa132
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "CryptoKeyAlgorithm.h"
+
+namespace WebCore {
+
+struct CryptoHmacKeyAlgorithm : CryptoKeyAlgorithm {
+    // The inner hash function to use.
+    CryptoKeyAlgorithm hash;
+    // The length (in bits) of the key.
+    unsigned length;
+};
+
+}
+
+
diff --git a/Source/WebCore/crypto/keys/CryptoHmacKeyAlgorithm.idl b/Source/WebCore/crypto/keys/CryptoHmacKeyAlgorithm.idl
new file mode 100644 (file)
index 0000000..4800659
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    Conditional=SUBTLE_CRYPTO,
+    JSGenerateToJSObject
+] dictionary CryptoHmacKeyAlgorithm : CryptoKeyAlgorithm {
+    // The inner hash function to use.
+    required CryptoKeyAlgorithm hash;
+    // The length (in bits) of the key.
+    required unsigned long length;
+};
index 9d4cd6caa3c79eb5c57db839a4a290947a581281..7af682849e613bb3f9052d28885534f2e74a4fc8 100644 (file)
 
 namespace WebCore {
 
+CryptoAesKeyAlgorithm AesKeyAlgorithm::dictionary() const
+{
+    CryptoAesKeyAlgorithm result;
+    result.name = this->name();
+    result.length = this->length();
+    return result;
+}
+
 static inline bool lengthIsValid(size_t length)
 {
     return (length == CryptoKeyAES::s_length128) || (length == CryptoKeyAES::s_length192) || (length == CryptoKeyAES::s_length256);
index 8160d2673c3e85a7ec3636b39a0919c516fd4a61..eb5c9d19ab711a7622531a28d0963214013650f7 100644 (file)
@@ -49,6 +49,8 @@ public:
 
     KeyAlgorithmClass keyAlgorithmClass() const final { return KeyAlgorithmClass::AES; }
 
+    CryptoAesKeyAlgorithm dictionary() const;
+
     size_t length() const { return m_length; }
 
 private:
similarity index 64%
rename from Source/WebCore/bindings/js/JSCryptoAlgorithmBuilder.h
rename to Source/WebCore/crypto/keys/CryptoKeyAlgorithm.h
index ce696aef2a4f3807a810e7604aeadefc940772c3..dcfeec9e76253ac19198ddd661f49b23642504a4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
 
 #pragma once
 
-#if ENABLE(SUBTLE_CRYPTO)
-
-#include <wtf/Forward.h>
-#include <wtf/Noncopyable.h>
-#include <wtf/Vector.h>
 #include <wtf/text/WTFString.h>
 
-namespace JSC {
-class ExecState;
-class JSObject;
-}
-
 namespace WebCore {
 
-class JSCryptoAlgorithmBuilder {
-    WTF_MAKE_NONCOPYABLE(JSCryptoAlgorithmBuilder);
-public:
-    JSCryptoAlgorithmBuilder(JSC::ExecState*);
-    virtual ~JSCryptoAlgorithmBuilder();
-
-    JSC::JSObject* result() const { return m_dictionary; }
-
-    void add(const char*, unsigned);
-    void add(const char*, const String&);
-    void add(const char*, const Vector<uint8_t>&);
-    void add(const char*, const JSCryptoAlgorithmBuilder&);
-
-private:
-    JSC::ExecState* m_exec;
-    JSC::JSObject* m_dictionary;
+struct CryptoKeyAlgorithm {
+    String name;
 };
 
-} // namespace WebCore
-
-#endif // ENABLE(SUBTLE_CRYPTO)
+}
diff --git a/Source/WebCore/crypto/keys/CryptoKeyAlgorithm.idl b/Source/WebCore/crypto/keys/CryptoKeyAlgorithm.idl
new file mode 100644 (file)
index 0000000..1cfd970
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    Conditional=SUBTLE_CRYPTO,
+    JSGenerateToJSObject
+] dictionary CryptoKeyAlgorithm {
+    required DOMString name;
+};
index bb5f335008053a1fb3308f1bb3fc74d748ac8ed2..ac4caf47f30bf7de6d6d32597d52fbd9ffb0c758 100644 (file)
 
 namespace WebCore {
 
+CryptoEcKeyAlgorithm EcKeyAlgorithm::dictionary() const
+{
+    CryptoEcKeyAlgorithm result;
+    result.name = this->name();
+    result.namedCurve = this->namedCurve();
+    return result;
+}
+
 static const char* const P256 = "P-256";
 static const char* const P384 = "P-384";
 
index 4c7d0298e8e794694d3b75070a80cc0d0c794eea..c6398c0cb5bc937a4e132f5dfe42d3af570016e2 100644 (file)
@@ -59,6 +59,8 @@ public:
 
     const String& namedCurve() const { return m_curve; }
 
+    CryptoEcKeyAlgorithm dictionary() const;
+
 private:
     String m_curve;
 };
index b8cfb61fb069c36e41b44453ba732bc471a96140..bb38b37027ebb8cf498f1f6eab05fae3f6da00b7 100644 (file)
 
 namespace WebCore {
 
+CryptoHmacKeyAlgorithm HmacKeyAlgorithm::dictionary() const
+{
+    CryptoHmacKeyAlgorithm result;
+    result.name = this->name();
+    result.hash.name = this->hash();
+    result.length = this->length();
+    return result;
+}
+
 static size_t getKeyLengthFromHash(CryptoAlgorithmIdentifier hash)
 {
     switch (hash) {
index 3f291685ac98244fd2be67d63db05b3bc6395f91..9a9d5b4e1603fa2473a2ee7169110e51b3899b93 100644 (file)
@@ -52,6 +52,8 @@ public:
     const String& hash() const { return m_hash; }
     size_t length() const { return m_length; }
 
+    CryptoHmacKeyAlgorithm dictionary() const;
+
 private:
     String m_hash;
     size_t m_length;
index 58ed86d22a12705d223cb1de1e7508c72fc67245..0d97559b6e7f232fb11b866d4cf7a342f94d1856 100644 (file)
 
 #include "CryptoKeyDataRSAComponents.h"
 #include "JsonWebKey.h"
+#include <JavaScriptCore/GenericTypedArrayViewInlines.h>
+#include <JavaScriptCore/JSGenericTypedArrayViewInlines.h>
+#include <heap/HeapInlines.h>
 #include <wtf/text/Base64.h>
 
 #if ENABLE(SUBTLE_CRYPTO)
 
 namespace WebCore {
 
+CryptoRsaKeyAlgorithm RsaKeyAlgorithm::dictionary() const
+{
+    CryptoRsaKeyAlgorithm result;
+    result.name = this->name();
+    result.modulusLength = this->modulusLength();
+    result.publicExponent = Uint8Array::create(this->publicExponent().data(), this->publicExponent().size());
+    return result;
+}
+
+CryptoRsaHashedKeyAlgorithm RsaHashedKeyAlgorithm::dictionary() const
+{
+    CryptoRsaHashedKeyAlgorithm result;
+    result.name = this->name();
+    result.modulusLength = this->modulusLength();
+    result.publicExponent = Uint8Array::create(this->publicExponent().data(), this->publicExponent().size());
+    result.hash.name = this->hash();
+    return result;
+}
+
 RefPtr<CryptoKeyRSA> CryptoKeyRSA::importJwk(CryptoAlgorithmIdentifier algorithm, std::optional<CryptoAlgorithmIdentifier> hash, JsonWebKey&& keyData, bool extractable, CryptoKeyUsageBitmap usages)
 {
     if (keyData.kty != "RSA")
index 41bce859ea308be9f6ea865d168a5c3b50aaa007..c7f9d04ca2e4109c4d7803b6c6471caa417e8f3e 100644 (file)
@@ -65,6 +65,8 @@ public:
     size_t modulusLength() const { return m_modulusLength; }
     const Vector<uint8_t>& publicExponent() const { return m_publicExponent; }
 
+    CryptoRsaKeyAlgorithm dictionary() const;
+
 private:
     size_t m_modulusLength;
     Vector<uint8_t> m_publicExponent;
@@ -82,6 +84,8 @@ public:
 
     const String& hash() const { return m_hash; }
 
+    CryptoRsaHashedKeyAlgorithm dictionary() const;
+
 private:
     String m_hash;
 };
index f0b1fff01c37f7e552e3474476f08fa23e354d13..48263c29724e2fd51e7e65aa8be529df7aa8d34f 100644 (file)
 
 namespace WebCore {
 
+CryptoKeyAlgorithm RawKeyAlgorithm::dictionary() const
+{
+    CryptoKeyAlgorithm result;
+    result.name = this->name();
+    return result;
+}
+
 CryptoKeyRaw::CryptoKeyRaw(CryptoAlgorithmIdentifier identifier, Vector<uint8_t>&& keyData, CryptoKeyUsageBitmap usages)
     : CryptoKey(identifier, CryptoKeyType::Secret, false, usages)
     , m_key(WTFMove(keyData))
index 43aaaa50820c5468d92e6d405047e7a04044513a..575c366b82567e88196fac76838988128019281d 100644 (file)
@@ -39,6 +39,8 @@ public:
     }
 
     KeyAlgorithmClass keyAlgorithmClass() const override { return KeyAlgorithmClass::Raw; }
+    
+    CryptoKeyAlgorithm dictionary() const;
 };
 
 class CryptoKeyRaw final : public CryptoKey {
diff --git a/Source/WebCore/crypto/keys/CryptoRsaHashedKeyAlgorithm.h b/Source/WebCore/crypto/keys/CryptoRsaHashedKeyAlgorithm.h
new file mode 100644 (file)
index 0000000..30109aa
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "CryptoRsaKeyAlgorithm.h"
+
+namespace WebCore {
+
+struct CryptoRsaHashedKeyAlgorithm : CryptoRsaKeyAlgorithm {
+    // The hash algorithm that is used with this key
+    CryptoKeyAlgorithm hash;
+};
+
+}
+
diff --git a/Source/WebCore/crypto/keys/CryptoRsaHashedKeyAlgorithm.idl b/Source/WebCore/crypto/keys/CryptoRsaHashedKeyAlgorithm.idl
new file mode 100644 (file)
index 0000000..2b4da72
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    Conditional=SUBTLE_CRYPTO,
+    JSGenerateToJSObject
+] dictionary CryptoRsaHashedKeyAlgorithm : CryptoRsaKeyAlgorithm {
+    // The hash algorithm that is used with this key
+    required CryptoKeyAlgorithm hash;
+};
diff --git a/Source/WebCore/crypto/keys/CryptoRsaKeyAlgorithm.h b/Source/WebCore/crypto/keys/CryptoRsaKeyAlgorithm.h
new file mode 100644 (file)
index 0000000..25cdc50
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "CryptoKeyAlgorithm.h"
+#include <runtime/Uint8Array.h>
+
+namespace WebCore {
+
+struct CryptoRsaKeyAlgorithm : CryptoKeyAlgorithm {
+    // The length, in bits, of the RSA modulus
+    unsigned modulusLength;
+    // The RSA public exponent
+    RefPtr<Uint8Array> publicExponent;
+};
+
+}
+
diff --git a/Source/WebCore/crypto/keys/CryptoRsaKeyAlgorithm.idl b/Source/WebCore/crypto/keys/CryptoRsaKeyAlgorithm.idl
new file mode 100644 (file)
index 0000000..718bb0e
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+typedef Uint8Array BigInteger;
+
+[
+    Conditional=SUBTLE_CRYPTO,
+    JSGenerateToJSObject
+] dictionary CryptoRsaKeyAlgorithm : CryptoKeyAlgorithm {
+    // The length, in bits, of the RSA modulus
+    required unsigned long modulusLength;
+    // The RSA public exponent
+    required BigInteger publicExponent;
+};