@breakside/jskit 2024.34.0 → 2024.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Frameworks/DOM.jsframework/Info.json +2 -2
- package/Frameworks/DOM.jsframework/io.breakside.JSKit.DOM-bundle.js +2 -2
- package/Frameworks/FontKit.jsframework/Info.json +2 -2
- package/Frameworks/FontKit.jsframework/io.breakside.JSKit.FontKit-bundle.js +2 -2
- package/Frameworks/Foundation.jsframework/Info.json +2 -2
- package/Frameworks/Foundation.jsframework/JS/Foundation+HTML.js +3 -1
- package/Frameworks/Foundation.jsframework/JS/JSClass.js +4 -1
- package/Frameworks/Foundation.jsframework/JS/JSHTMLUserAgent.js +130 -0
- package/Frameworks/Foundation.jsframework/JS/JSNodeURLSessionStreamTask.js +1 -1
- package/Frameworks/Foundation.jsframework/io.breakside.JSKit.Foundation-bundle.js +2 -2
- package/Frameworks/Foundation.jsframework/sources.json +3 -1
- package/Frameworks/SecurityKit.jsframework/Info.json +2 -2
- package/Frameworks/SecurityKit.jsframework/JS/SECCBOR.js +4 -0
- package/Frameworks/SecurityKit.jsframework/JS/SECCOSE.js +135 -0
- package/Frameworks/SecurityKit.jsframework/JS/SECCipher+HTML.js +231 -70
- package/Frameworks/SecurityKit.jsframework/JS/SECCipher+Node.js +155 -60
- package/Frameworks/SecurityKit.jsframework/JS/SECCipher.js +125 -54
- package/Frameworks/SecurityKit.jsframework/JS/SECDataKey.js +5 -4
- package/Frameworks/SecurityKit.jsframework/JS/SECHMAC+HTML.js +15 -11
- package/Frameworks/SecurityKit.jsframework/JS/SECHMAC+Node.js +17 -3
- package/Frameworks/SecurityKit.jsframework/JS/SECHTMLDeviceAuthentication.js +206 -120
- package/Frameworks/SecurityKit.jsframework/JS/SECHTMLKey.js +17 -0
- package/Frameworks/SecurityKit.jsframework/JS/SECHash.js +1 -0
- package/Frameworks/SecurityKit.jsframework/JS/SECJSONWebAlgorithms.js +9 -1
- package/Frameworks/SecurityKit.jsframework/JS/SECJSONWebEncryption.js +391 -0
- package/Frameworks/SecurityKit.jsframework/JS/SECJSONWebToken.js +1 -1
- package/Frameworks/SecurityKit.jsframework/JS/SECKey.js +14 -1
- package/Frameworks/SecurityKit.jsframework/JS/SECNodeKey.js +66 -1
- package/Frameworks/SecurityKit.jsframework/JS/SECSign+HTML.js +2 -27
- package/Frameworks/SecurityKit.jsframework/JS/SECSign+Node.js +103 -278
- package/Frameworks/SecurityKit.jsframework/JS/SECSign.js +27 -0
- package/Frameworks/SecurityKit.jsframework/JS/SECVerify+Node.js +60 -57
- package/Frameworks/SecurityKit.jsframework/JS/SecurityKit.js +1 -0
- package/Frameworks/SecurityKit.jsframework/io.breakside.JSKit.SecurityKit-bundle.js +2 -2
- package/Frameworks/SecurityKit.jsframework/sources.json +6 -0
- package/Info.json +2 -2
- package/Node/KeyCommand.js +8 -1
- package/Node/io.breakside.jskit-bundle.js +2 -2
- package/Node/jskit +1 -0
- package/Root/Frameworks/APIKit/Info.yaml +1 -1
- package/Root/Frameworks/APIKitTesting/Info.yaml +1 -1
- package/Root/Frameworks/AuthKit/Info.yaml +1 -1
- package/Root/Frameworks/CSSOM/Info.yaml +1 -1
- package/Root/Frameworks/ChartKit/Info.yaml +1 -1
- package/Root/Frameworks/ConferenceKit/Info.yaml +1 -1
- package/Root/Frameworks/DBKit/DBEncryptedObject.js +2 -2
- package/Root/Frameworks/DBKit/Info.yaml +1 -1
- package/Root/Frameworks/DOM/Info.yaml +1 -1
- package/Root/Frameworks/Dispatch/Info.yaml +1 -1
- package/Root/Frameworks/FontKit/Info.yaml +1 -1
- package/Root/Frameworks/Foundation/Foundation+HTML.js +3 -1
- package/Root/Frameworks/Foundation/Info.yaml +1 -1
- package/Root/Frameworks/Foundation/JSClass.js +4 -1
- package/Root/Frameworks/Foundation/JSHTMLUserAgent.js +130 -0
- package/Root/Frameworks/Foundation/JSNodeURLSessionStreamTask.js +1 -1
- package/Root/Frameworks/ImageKit/Info.yaml +1 -1
- package/Root/Frameworks/MediaKit/Info.yaml +1 -1
- package/Root/Frameworks/MediaKitUI/Info.yaml +1 -1
- package/Root/Frameworks/NotificationKit/Info.yaml +1 -1
- package/Root/Frameworks/NotificationKit/NKWebPushService.js +2 -2
- package/Root/Frameworks/PDFKit/Info.yaml +1 -1
- package/Root/Frameworks/PDFKit/PDFEncryption.js +1 -1
- package/Root/Frameworks/QRKit/Info.yaml +1 -1
- package/Root/Frameworks/SearchKit/Info.yaml +1 -1
- package/Root/Frameworks/SecurityKit/Info.yaml +1 -1
- package/Root/Frameworks/SecurityKit/SECCBOR.js +4 -0
- package/Root/Frameworks/SecurityKit/SECCOSE.js +135 -0
- package/Root/Frameworks/SecurityKit/SECCipher+HTML.js +231 -70
- package/Root/Frameworks/SecurityKit/SECCipher+Node.js +155 -60
- package/Root/Frameworks/SecurityKit/SECCipher.js +125 -54
- package/Root/Frameworks/SecurityKit/SECDataKey.js +5 -4
- package/Root/Frameworks/SecurityKit/SECHMAC+HTML.js +15 -11
- package/Root/Frameworks/SecurityKit/SECHMAC+Node.js +17 -3
- package/Root/Frameworks/SecurityKit/SECHTMLDeviceAuthentication.js +206 -120
- package/Root/Frameworks/SecurityKit/SECHTMLKey.js +17 -0
- package/Root/Frameworks/SecurityKit/SECHash.js +1 -0
- package/Root/Frameworks/SecurityKit/SECJSONWebAlgorithms.js +9 -1
- package/Root/Frameworks/SecurityKit/SECJSONWebEncryption.js +391 -0
- package/Root/Frameworks/SecurityKit/SECJSONWebToken.js +1 -1
- package/Root/Frameworks/SecurityKit/SECKey.js +14 -1
- package/Root/Frameworks/SecurityKit/SECNodeKey.js +66 -1
- package/Root/Frameworks/SecurityKit/SECSign+HTML.js +2 -27
- package/Root/Frameworks/SecurityKit/SECSign+Node.js +103 -278
- package/Root/Frameworks/SecurityKit/SECSign.js +27 -0
- package/Root/Frameworks/SecurityKit/SECVerify+Node.js +60 -57
- package/Root/Frameworks/SecurityKit/SecurityKit.js +1 -0
- package/Root/Frameworks/ServerKit/Info.yaml +1 -1
- package/Root/Frameworks/ServerKitTesting/Info.yaml +1 -1
- package/Root/Frameworks/TestKit/Info.yaml +1 -1
- package/Root/Frameworks/UIKit/Info.yaml +1 -1
- package/Root/Frameworks/UIKit/UIPlatform+HTML.js +2 -1
- package/Root/Frameworks/UIKitTesting/Info.yaml +1 -1
- package/package.json +1 -1
- package/Root/Templates/workspace/.gitignore +0 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"JSBundleType": "framework",
|
|
3
3
|
"JSBundleIdentifier": "io.breakside.JSKit.DOM",
|
|
4
|
-
"JSBundleVersion": "2024.
|
|
4
|
+
"JSBundleVersion": "2024.41.0",
|
|
5
5
|
"JSDevelopmentLanguage": "en",
|
|
6
6
|
"JSCopyright": "Copyright © 2020 Breakside Inc.",
|
|
7
7
|
"JSBundleEnvironments": {
|
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
"node": "DOM+Node.js"
|
|
10
10
|
},
|
|
11
11
|
"JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
|
|
12
|
-
"GitRevision": "
|
|
12
|
+
"GitRevision": "bf643e90b060044223efa5a59f0d727332802563"
|
|
13
13
|
}
|
|
@@ -3,7 +3,7 @@ JSBundle.bundles['io.breakside.JSKit.DOM'] = {
|
|
|
3
3
|
"Info": {
|
|
4
4
|
"JSBundleType": "framework",
|
|
5
5
|
"JSBundleIdentifier": "io.breakside.JSKit.DOM",
|
|
6
|
-
"JSBundleVersion": "2024.
|
|
6
|
+
"JSBundleVersion": "2024.41.0",
|
|
7
7
|
"JSDevelopmentLanguage": "en",
|
|
8
8
|
"JSCopyright": "Copyright © 2020 Breakside Inc.",
|
|
9
9
|
"JSBundleEnvironments": {
|
|
@@ -11,7 +11,7 @@ JSBundle.bundles['io.breakside.JSKit.DOM'] = {
|
|
|
11
11
|
"node": "DOM+Node.js"
|
|
12
12
|
},
|
|
13
13
|
"JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
|
|
14
|
-
"GitRevision": "
|
|
14
|
+
"GitRevision": "bf643e90b060044223efa5a59f0d727332802563"
|
|
15
15
|
},
|
|
16
16
|
"Resources": [],
|
|
17
17
|
"ResourceLookup": {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"JSBundleType": "framework",
|
|
3
3
|
"JSBundleIdentifier": "io.breakside.JSKit.FontKit",
|
|
4
|
-
"JSBundleVersion": "2024.
|
|
4
|
+
"JSBundleVersion": "2024.41.0",
|
|
5
5
|
"JSDevelopmentLanguage": "en",
|
|
6
6
|
"JSCopyright": "Copyright © 2020 Breakside Inc.",
|
|
7
7
|
"JSBundleEnvironments": {
|
|
8
8
|
"html": "FontKit+HTML.js"
|
|
9
9
|
},
|
|
10
10
|
"JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
|
|
11
|
-
"GitRevision": "
|
|
11
|
+
"GitRevision": "bf643e90b060044223efa5a59f0d727332802563"
|
|
12
12
|
}
|
|
@@ -3,14 +3,14 @@ JSBundle.bundles['io.breakside.JSKit.FontKit'] = {
|
|
|
3
3
|
"Info": {
|
|
4
4
|
"JSBundleType": "framework",
|
|
5
5
|
"JSBundleIdentifier": "io.breakside.JSKit.FontKit",
|
|
6
|
-
"JSBundleVersion": "2024.
|
|
6
|
+
"JSBundleVersion": "2024.41.0",
|
|
7
7
|
"JSDevelopmentLanguage": "en",
|
|
8
8
|
"JSCopyright": "Copyright © 2020 Breakside Inc.",
|
|
9
9
|
"JSBundleEnvironments": {
|
|
10
10
|
"html": "FontKit+HTML.js"
|
|
11
11
|
},
|
|
12
12
|
"JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
|
|
13
|
-
"GitRevision": "
|
|
13
|
+
"GitRevision": "bf643e90b060044223efa5a59f0d727332802563"
|
|
14
14
|
},
|
|
15
15
|
"Resources": [],
|
|
16
16
|
"ResourceLookup": {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"JSBundleType": "framework",
|
|
3
3
|
"JSBundleIdentifier": "io.breakside.JSKit.Foundation",
|
|
4
|
-
"JSBundleVersion": "2024.
|
|
4
|
+
"JSBundleVersion": "2024.41.0",
|
|
5
5
|
"JSDevelopmentLanguage": "en",
|
|
6
6
|
"JSCopyright": "Copyright © 2020 Breakside Inc.",
|
|
7
7
|
"JSBundleEnvironments": {
|
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
"node": "Foundation+Node.js"
|
|
10
10
|
},
|
|
11
11
|
"JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
|
|
12
|
-
"GitRevision": "
|
|
12
|
+
"GitRevision": "bf643e90b060044223efa5a59f0d727332802563"
|
|
13
13
|
}
|
|
@@ -177,7 +177,10 @@ JSClass.prototype = {
|
|
|
177
177
|
}
|
|
178
178
|
if (result instanceof Promise){
|
|
179
179
|
return result.then(function(promiseResult){
|
|
180
|
-
|
|
180
|
+
if (promiseResult === undefined){
|
|
181
|
+
return obj;
|
|
182
|
+
}
|
|
183
|
+
return promiseResult;
|
|
181
184
|
});
|
|
182
185
|
}
|
|
183
186
|
return result;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
// Copyright 2021 Breakside Inc.
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Breakside Public License, Version 1.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// If a copy of the License was not distributed with this file, you may
|
|
6
|
+
// obtain a copy at
|
|
7
|
+
//
|
|
8
|
+
// http://breakside.io/licenses/LICENSE-1.0.txt
|
|
9
|
+
//
|
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
// See the License for the specific language governing permissions and
|
|
14
|
+
// limitations under the License.
|
|
15
|
+
|
|
16
|
+
// #import "JSObject.js"
|
|
17
|
+
"use strict";
|
|
18
|
+
|
|
19
|
+
JSClass("JSHTMLUserAgent", JSObject, {
|
|
20
|
+
|
|
21
|
+
string: null,
|
|
22
|
+
products: null,
|
|
23
|
+
productsByIdentifier: null,
|
|
24
|
+
comments: null,
|
|
25
|
+
commentSet: null,
|
|
26
|
+
|
|
27
|
+
initWithString: function(string){
|
|
28
|
+
if (string === null || string === undefined){
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
this.string = string;
|
|
32
|
+
this.products = [];
|
|
33
|
+
this.productsByIdentifier = new Set();
|
|
34
|
+
this.comments = [];
|
|
35
|
+
this.commentSet = new Set();
|
|
36
|
+
this.parse();
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
parse: function(){
|
|
40
|
+
var str = this.string;
|
|
41
|
+
var i = 0;
|
|
42
|
+
var l = this.string.length;
|
|
43
|
+
var product = "";
|
|
44
|
+
var version = "";
|
|
45
|
+
var comment = "";
|
|
46
|
+
while (i < l){
|
|
47
|
+
while (str[i] == " " || str[i] == "\t"){
|
|
48
|
+
++i;
|
|
49
|
+
}
|
|
50
|
+
if (i < l){
|
|
51
|
+
if (str[i] == "("){
|
|
52
|
+
comment = "";
|
|
53
|
+
++i;
|
|
54
|
+
while (i < l && str[i] !== ")"){
|
|
55
|
+
if (str[i] == ";"){
|
|
56
|
+
comment = comment.trim();
|
|
57
|
+
if (comment !== ""){
|
|
58
|
+
this.addComment(comment);
|
|
59
|
+
}
|
|
60
|
+
comment = "";
|
|
61
|
+
}else{
|
|
62
|
+
comment += str[i];
|
|
63
|
+
}
|
|
64
|
+
++i;
|
|
65
|
+
}
|
|
66
|
+
comment = comment.trim();
|
|
67
|
+
if (comment !== ""){
|
|
68
|
+
this.addComment(comment);
|
|
69
|
+
}
|
|
70
|
+
if (i < l){
|
|
71
|
+
++i;
|
|
72
|
+
}
|
|
73
|
+
}else{
|
|
74
|
+
product = "";
|
|
75
|
+
version = "";
|
|
76
|
+
while (i < l && str[i] !== "/" && str[i] !== " " && str[i] !== "\t"){
|
|
77
|
+
product += str[i];
|
|
78
|
+
++i;
|
|
79
|
+
}
|
|
80
|
+
if (i < l && str[i] == "/"){
|
|
81
|
+
++i;
|
|
82
|
+
while (i < l && str[i] !== "(" && str[i] !== " " && str[i] !== "\t"){
|
|
83
|
+
version += str[i];
|
|
84
|
+
++i;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
this.addProduct(product, version);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
addProduct: function(name, version){
|
|
94
|
+
if (version === "" || version === undefined){
|
|
95
|
+
version = null;
|
|
96
|
+
}
|
|
97
|
+
var product = {name: name, version: version};
|
|
98
|
+
this.products.push(product);
|
|
99
|
+
this.productsByIdentifier[name] = product;
|
|
100
|
+
if (version !== null){
|
|
101
|
+
this.productsByIdentifier["%s/%s".sprintf(name, version)] = product;
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
|
|
105
|
+
addComment: function(comment){
|
|
106
|
+
this.comments.push(comment);
|
|
107
|
+
this.commentSet.add(comment);
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
containsProduct: function(name, version){
|
|
111
|
+
if (version === undefined || version === null || version === ""){
|
|
112
|
+
return name in this.productsByIdentifier;
|
|
113
|
+
}
|
|
114
|
+
return "%s/%s".sprintf(name, version) in this.productsByIdentifier;
|
|
115
|
+
},
|
|
116
|
+
|
|
117
|
+
versionOfProduct: function(name){
|
|
118
|
+
var product = this.productsByIdentifier[name];
|
|
119
|
+
if (product){
|
|
120
|
+
return product.version;
|
|
121
|
+
}
|
|
122
|
+
return null;
|
|
123
|
+
},
|
|
124
|
+
|
|
125
|
+
containsComment: function(comment){
|
|
126
|
+
return this.commentSet.has(comment);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
});
|
|
130
|
+
|
|
@@ -92,7 +92,7 @@ JSClass("JSNodeURLSessionStreamTask", JSURLSessionStreamTask, {
|
|
|
92
92
|
},
|
|
93
93
|
|
|
94
94
|
write: function(data){
|
|
95
|
-
this.socket.write(data.nodeBuffer);
|
|
95
|
+
this.socket.write(data.nodeBuffer());
|
|
96
96
|
},
|
|
97
97
|
|
|
98
98
|
// ----------------------------------------------------------------------
|
|
@@ -3,7 +3,7 @@ JSBundle.bundles['io.breakside.JSKit.Foundation'] = {
|
|
|
3
3
|
"Info": {
|
|
4
4
|
"JSBundleType": "framework",
|
|
5
5
|
"JSBundleIdentifier": "io.breakside.JSKit.Foundation",
|
|
6
|
-
"JSBundleVersion": "2024.
|
|
6
|
+
"JSBundleVersion": "2024.41.0",
|
|
7
7
|
"JSDevelopmentLanguage": "en",
|
|
8
8
|
"JSCopyright": "Copyright © 2020 Breakside Inc.",
|
|
9
9
|
"JSBundleEnvironments": {
|
|
@@ -11,7 +11,7 @@ JSBundle.bundles['io.breakside.JSKit.Foundation'] = {
|
|
|
11
11
|
"node": "Foundation+Node.js"
|
|
12
12
|
},
|
|
13
13
|
"JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
|
|
14
|
-
"GitRevision": "
|
|
14
|
+
"GitRevision": "bf643e90b060044223efa5a59f0d727332802563"
|
|
15
15
|
},
|
|
16
16
|
"Resources": [
|
|
17
17
|
{
|
|
@@ -295,6 +295,7 @@
|
|
|
295
295
|
"JSFile+HTML.js",
|
|
296
296
|
"JSHTMLFile.js",
|
|
297
297
|
"JSHTMLFileEnumerator.js",
|
|
298
|
+
"JSHTMLUserAgent.js",
|
|
298
299
|
"Foundation+HTML.js"
|
|
299
300
|
],
|
|
300
301
|
"features": [
|
|
@@ -316,7 +317,8 @@
|
|
|
316
317
|
"JSHTMLFileManager",
|
|
317
318
|
"JSHTMLFile",
|
|
318
319
|
"JSHTMLFileListFileEnumerator",
|
|
319
|
-
"JSHTMLFileSystemEntryFileEnumerator"
|
|
320
|
+
"JSHTMLFileSystemEntryFileEnumerator",
|
|
321
|
+
"JSHTMLUserAgent"
|
|
320
322
|
]
|
|
321
323
|
},
|
|
322
324
|
"node": {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"JSBundleType": "framework",
|
|
3
3
|
"JSBundleIdentifier": "io.breakside.JSKit.SecurityKit",
|
|
4
|
-
"JSBundleVersion": "2024.
|
|
4
|
+
"JSBundleVersion": "2024.41.0",
|
|
5
5
|
"JSDevelopmentLanguage": "en",
|
|
6
6
|
"JSCopyright": "Copyright © 2020 Breakside Inc.",
|
|
7
7
|
"JSBundleEnvironments": {
|
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
"node": "SecurityKit+Node.js"
|
|
10
10
|
},
|
|
11
11
|
"JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
|
|
12
|
-
"GitRevision": "
|
|
12
|
+
"GitRevision": "bf643e90b060044223efa5a59f0d727332802563"
|
|
13
13
|
}
|
|
@@ -44,6 +44,9 @@ JSClass("SECCBORParser", JSObject, {
|
|
|
44
44
|
},
|
|
45
45
|
|
|
46
46
|
readNext: function(){
|
|
47
|
+
if (this.offset >= this.data.length){
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
47
50
|
var b = this.data[this.offset++];
|
|
48
51
|
var info = b & 0x1F;
|
|
49
52
|
var majorType = (b & 0xE0) >> 5;
|
|
@@ -65,6 +68,7 @@ JSClass("SECCBORParser", JSObject, {
|
|
|
65
68
|
case SECCBOR.MajorType.other:
|
|
66
69
|
return this.readOther(info);
|
|
67
70
|
}
|
|
71
|
+
return null;
|
|
68
72
|
},
|
|
69
73
|
|
|
70
74
|
readUnsignedInteger: function(info){
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
// #import Foundation
|
|
2
|
+
// #import "SECCBOR.js"
|
|
3
|
+
// #import "SECJSONWebAlgorithms.js"
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
(function(){
|
|
7
|
+
|
|
8
|
+
JSClass("SECCOSE", JSObject, {
|
|
9
|
+
|
|
10
|
+
dictionary: null,
|
|
11
|
+
|
|
12
|
+
initWithData: function(data){
|
|
13
|
+
var parser = SECCBORParser.initWithData(data);
|
|
14
|
+
this.dictionary = parser.readNext();
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
attribute: function(attr){
|
|
18
|
+
return this.dictionary[attr] || null;
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
derRepresentation: function(){
|
|
22
|
+
return JSData.init();
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
jwkRepresentation: function(){
|
|
26
|
+
var jwk = {};
|
|
27
|
+
switch (this.attribute(SECCOSE.Attribute.kty)){
|
|
28
|
+
case SECCOSE.KeyType.ellipticCurve:
|
|
29
|
+
jwk.kty = SECJSONWebAlgorithms.KeyType.ellipticCurve;
|
|
30
|
+
switch (this.attribute(SECCOSE.Attribute.alg)){
|
|
31
|
+
case SECCOSE.Algorithm.ellipticCurveSHA256:
|
|
32
|
+
jwk.alg = SECJSONWebAlgorithms.Algorithm.ellipticCurveSHA256;
|
|
33
|
+
break;
|
|
34
|
+
case SECCOSE.Algorithm.ellipticCurveSHA384:
|
|
35
|
+
jwk.alg = SECJSONWebAlgorithms.Algorithm.ellipticCurveSHA384;
|
|
36
|
+
break;
|
|
37
|
+
case SECCOSE.Algorithm.ellipticCurveSHA512:
|
|
38
|
+
jwk.alg = SECJSONWebAlgorithms.Algorithm.ellipticCurveSHA512;
|
|
39
|
+
break;
|
|
40
|
+
default:
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
switch (this.attribute(SECCOSE.Attribute.ellipticCurve_crv)){
|
|
44
|
+
case SECCOSE.EllipticCurve.p256:
|
|
45
|
+
jwk.crv = SECJSONWebAlgorithms.EllipticCurve.p256;
|
|
46
|
+
break;
|
|
47
|
+
case SECCOSE.EllipticCurve.p384:
|
|
48
|
+
jwk.crv = SECJSONWebAlgorithms.EllipticCurve.p384;
|
|
49
|
+
break;
|
|
50
|
+
case SECCOSE.EllipticCurve.p521:
|
|
51
|
+
jwk.crv = SECJSONWebAlgorithms.EllipticCurve.p521;
|
|
52
|
+
break;
|
|
53
|
+
default:
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
jwk.x = this.attribute(SECCOSE.Attribute.ellipticCurve_x).base64URLStringRepresentation();
|
|
57
|
+
jwk.y = this.attribute(SECCOSE.Attribute.ellipticCurve_y).base64URLStringRepresentation();
|
|
58
|
+
break;
|
|
59
|
+
case SECCOSE.KeyType.rsa:
|
|
60
|
+
jwk.kty = SECJSONWebAlgorithms.KeyType.rsa;
|
|
61
|
+
switch (this.attribute(SECCOSE.Attribute.alg)){
|
|
62
|
+
case SECCOSE.Algorithm.rsaSHA256:
|
|
63
|
+
jwk.alg = SECJSONWebAlgorithms.Algorithm.rsaSHA256;
|
|
64
|
+
break;
|
|
65
|
+
case SECCOSE.Algorithm.rsaSHA384:
|
|
66
|
+
jwk.alg = SECJSONWebAlgorithms.Algorithm.rsaSHA384;
|
|
67
|
+
break;
|
|
68
|
+
case SECCOSE.Algorithm.rsaSHA512:
|
|
69
|
+
jwk.alg = SECJSONWebAlgorithms.Algorithm.rsaSHA512;
|
|
70
|
+
break;
|
|
71
|
+
default:
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
jwk.n = this.attribute(SECCOSE.Attribute.rsa_n).base64URLStringRepresentation();
|
|
75
|
+
jwk.e = this.attribute(SECCOSE.Attribute.rsa_e).base64URLStringRepresentation();
|
|
76
|
+
break;
|
|
77
|
+
default:
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
return jwk;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
SECCOSE.KeyType = {
|
|
86
|
+
ellipticCurve: 2,
|
|
87
|
+
rsa: 3,
|
|
88
|
+
symmetric: 4,
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
SECCOSE.Algorithm = {
|
|
92
|
+
rsaSHA256: -257,
|
|
93
|
+
rsaSHA384: -258,
|
|
94
|
+
rsaSHA512: -259,
|
|
95
|
+
ellipticCurveSHA256: -7,
|
|
96
|
+
ellipticCurveSHA384: -35,
|
|
97
|
+
ellipticCurveSHA512: -36,
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
SECCOSE.EllipticCurve = {
|
|
101
|
+
p256: 1,
|
|
102
|
+
p384: 2,
|
|
103
|
+
p521: 3
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
SECCOSE.Attribute = {
|
|
107
|
+
kty: 1,
|
|
108
|
+
kid: 2,
|
|
109
|
+
alg: 3,
|
|
110
|
+
key_ops: 4,
|
|
111
|
+
|
|
112
|
+
ellipticCurve_crv: -1,
|
|
113
|
+
ellipticCurve_x: -2,
|
|
114
|
+
ellipticCurve_y: -3,
|
|
115
|
+
ellipticCurve_d: -4,
|
|
116
|
+
|
|
117
|
+
rsa_n: -1,
|
|
118
|
+
rsa_e: -2,
|
|
119
|
+
rsa_d: -3,
|
|
120
|
+
rsa_p: -4,
|
|
121
|
+
rsa_q: -5,
|
|
122
|
+
rsa_dP: -6,
|
|
123
|
+
rsa_dQ: -7,
|
|
124
|
+
rsa_qInv: -8,
|
|
125
|
+
rsa_other: -9,
|
|
126
|
+
rsa_r_i: -10,
|
|
127
|
+
rsa_d_i: -11,
|
|
128
|
+
rsa_t_i: -12,
|
|
129
|
+
|
|
130
|
+
symmetric_k: -1
|
|
131
|
+
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
})();
|