@breakside/jskit 2024.34.0 → 2024.40.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.
Files changed (86) hide show
  1. package/Frameworks/DOM.jsframework/Info.json +2 -2
  2. package/Frameworks/DOM.jsframework/io.breakside.JSKit.DOM-bundle.js +2 -2
  3. package/Frameworks/FontKit.jsframework/Info.json +2 -2
  4. package/Frameworks/FontKit.jsframework/io.breakside.JSKit.FontKit-bundle.js +2 -2
  5. package/Frameworks/Foundation.jsframework/Info.json +2 -2
  6. package/Frameworks/Foundation.jsframework/JS/JSClass.js +4 -1
  7. package/Frameworks/Foundation.jsframework/JS/JSNodeURLSessionStreamTask.js +1 -1
  8. package/Frameworks/Foundation.jsframework/io.breakside.JSKit.Foundation-bundle.js +2 -2
  9. package/Frameworks/SecurityKit.jsframework/Info.json +2 -2
  10. package/Frameworks/SecurityKit.jsframework/JS/SECCOSE.js +135 -0
  11. package/Frameworks/SecurityKit.jsframework/JS/SECCipher+HTML.js +231 -70
  12. package/Frameworks/SecurityKit.jsframework/JS/SECCipher+Node.js +155 -60
  13. package/Frameworks/SecurityKit.jsframework/JS/SECCipher.js +125 -54
  14. package/Frameworks/SecurityKit.jsframework/JS/SECDataKey.js +5 -4
  15. package/Frameworks/SecurityKit.jsframework/JS/SECHMAC+HTML.js +15 -11
  16. package/Frameworks/SecurityKit.jsframework/JS/SECHMAC+Node.js +17 -3
  17. package/Frameworks/SecurityKit.jsframework/JS/SECHTMLDeviceAuthentication.js +139 -106
  18. package/Frameworks/SecurityKit.jsframework/JS/SECHTMLKey.js +17 -0
  19. package/Frameworks/SecurityKit.jsframework/JS/SECHash.js +1 -0
  20. package/Frameworks/SecurityKit.jsframework/JS/SECJSONWebAlgorithms.js +9 -1
  21. package/Frameworks/SecurityKit.jsframework/JS/SECJSONWebEncryption.js +391 -0
  22. package/Frameworks/SecurityKit.jsframework/JS/SECJSONWebToken.js +1 -1
  23. package/Frameworks/SecurityKit.jsframework/JS/SECKey.js +14 -1
  24. package/Frameworks/SecurityKit.jsframework/JS/SECNodeKey.js +66 -1
  25. package/Frameworks/SecurityKit.jsframework/JS/SECSign+HTML.js +2 -27
  26. package/Frameworks/SecurityKit.jsframework/JS/SECSign+Node.js +103 -278
  27. package/Frameworks/SecurityKit.jsframework/JS/SECSign.js +27 -0
  28. package/Frameworks/SecurityKit.jsframework/JS/SECVerify+Node.js +60 -57
  29. package/Frameworks/SecurityKit.jsframework/JS/SecurityKit.js +1 -0
  30. package/Frameworks/SecurityKit.jsframework/io.breakside.JSKit.SecurityKit-bundle.js +2 -2
  31. package/Frameworks/SecurityKit.jsframework/sources.json +6 -0
  32. package/Info.json +2 -2
  33. package/Node/KeyCommand.js +8 -1
  34. package/Node/io.breakside.jskit-bundle.js +2 -2
  35. package/Node/jskit +1 -0
  36. package/Root/Frameworks/APIKit/Info.yaml +1 -1
  37. package/Root/Frameworks/APIKitTesting/Info.yaml +1 -1
  38. package/Root/Frameworks/AuthKit/Info.yaml +1 -1
  39. package/Root/Frameworks/CSSOM/Info.yaml +1 -1
  40. package/Root/Frameworks/ChartKit/Info.yaml +1 -1
  41. package/Root/Frameworks/ConferenceKit/Info.yaml +1 -1
  42. package/Root/Frameworks/DBKit/DBEncryptedObject.js +2 -2
  43. package/Root/Frameworks/DBKit/Info.yaml +1 -1
  44. package/Root/Frameworks/DOM/Info.yaml +1 -1
  45. package/Root/Frameworks/Dispatch/Info.yaml +1 -1
  46. package/Root/Frameworks/FontKit/Info.yaml +1 -1
  47. package/Root/Frameworks/Foundation/Info.yaml +1 -1
  48. package/Root/Frameworks/Foundation/JSClass.js +4 -1
  49. package/Root/Frameworks/Foundation/JSNodeURLSessionStreamTask.js +1 -1
  50. package/Root/Frameworks/ImageKit/Info.yaml +1 -1
  51. package/Root/Frameworks/MediaKit/Info.yaml +1 -1
  52. package/Root/Frameworks/MediaKitUI/Info.yaml +1 -1
  53. package/Root/Frameworks/NotificationKit/Info.yaml +1 -1
  54. package/Root/Frameworks/NotificationKit/NKWebPushService.js +2 -2
  55. package/Root/Frameworks/PDFKit/Info.yaml +1 -1
  56. package/Root/Frameworks/PDFKit/PDFEncryption.js +1 -1
  57. package/Root/Frameworks/QRKit/Info.yaml +1 -1
  58. package/Root/Frameworks/SearchKit/Info.yaml +1 -1
  59. package/Root/Frameworks/SecurityKit/Info.yaml +1 -1
  60. package/Root/Frameworks/SecurityKit/SECCOSE.js +135 -0
  61. package/Root/Frameworks/SecurityKit/SECCipher+HTML.js +231 -70
  62. package/Root/Frameworks/SecurityKit/SECCipher+Node.js +155 -60
  63. package/Root/Frameworks/SecurityKit/SECCipher.js +125 -54
  64. package/Root/Frameworks/SecurityKit/SECDataKey.js +5 -4
  65. package/Root/Frameworks/SecurityKit/SECHMAC+HTML.js +15 -11
  66. package/Root/Frameworks/SecurityKit/SECHMAC+Node.js +17 -3
  67. package/Root/Frameworks/SecurityKit/SECHTMLDeviceAuthentication.js +139 -106
  68. package/Root/Frameworks/SecurityKit/SECHTMLKey.js +17 -0
  69. package/Root/Frameworks/SecurityKit/SECHash.js +1 -0
  70. package/Root/Frameworks/SecurityKit/SECJSONWebAlgorithms.js +9 -1
  71. package/Root/Frameworks/SecurityKit/SECJSONWebEncryption.js +391 -0
  72. package/Root/Frameworks/SecurityKit/SECJSONWebToken.js +1 -1
  73. package/Root/Frameworks/SecurityKit/SECKey.js +14 -1
  74. package/Root/Frameworks/SecurityKit/SECNodeKey.js +66 -1
  75. package/Root/Frameworks/SecurityKit/SECSign+HTML.js +2 -27
  76. package/Root/Frameworks/SecurityKit/SECSign+Node.js +103 -278
  77. package/Root/Frameworks/SecurityKit/SECSign.js +27 -0
  78. package/Root/Frameworks/SecurityKit/SECVerify+Node.js +60 -57
  79. package/Root/Frameworks/SecurityKit/SecurityKit.js +1 -0
  80. package/Root/Frameworks/ServerKit/Info.yaml +1 -1
  81. package/Root/Frameworks/ServerKitTesting/Info.yaml +1 -1
  82. package/Root/Frameworks/TestKit/Info.yaml +1 -1
  83. package/Root/Frameworks/UIKit/Info.yaml +1 -1
  84. package/Root/Frameworks/UIKitTesting/Info.yaml +1 -1
  85. package/package.json +1 -1
  86. 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.34.0",
4
+ "JSBundleVersion": "2024.40.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": "61333aba82f5c25a000319a71a75eaed5fa1d713"
12
+ "GitRevision": "f17cafe60642c3c9674095789dec1d1803b72586"
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.34.0",
6
+ "JSBundleVersion": "2024.40.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": "61333aba82f5c25a000319a71a75eaed5fa1d713"
14
+ "GitRevision": "f17cafe60642c3c9674095789dec1d1803b72586"
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.34.0",
4
+ "JSBundleVersion": "2024.40.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": "61333aba82f5c25a000319a71a75eaed5fa1d713"
11
+ "GitRevision": "f17cafe60642c3c9674095789dec1d1803b72586"
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.34.0",
6
+ "JSBundleVersion": "2024.40.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": "61333aba82f5c25a000319a71a75eaed5fa1d713"
13
+ "GitRevision": "f17cafe60642c3c9674095789dec1d1803b72586"
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.34.0",
4
+ "JSBundleVersion": "2024.40.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": "61333aba82f5c25a000319a71a75eaed5fa1d713"
12
+ "GitRevision": "f17cafe60642c3c9674095789dec1d1803b72586"
13
13
  }
@@ -177,7 +177,10 @@ JSClass.prototype = {
177
177
  }
178
178
  if (result instanceof Promise){
179
179
  return result.then(function(promiseResult){
180
- return promiseResult || obj;
180
+ if (promiseResult === undefined){
181
+ return obj;
182
+ }
183
+ return promiseResult;
181
184
  });
182
185
  }
183
186
  return result;
@@ -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.34.0",
6
+ "JSBundleVersion": "2024.40.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": "61333aba82f5c25a000319a71a75eaed5fa1d713"
14
+ "GitRevision": "f17cafe60642c3c9674095789dec1d1803b72586"
15
15
  },
16
16
  "Resources": [
17
17
  {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "JSBundleType": "framework",
3
3
  "JSBundleIdentifier": "io.breakside.JSKit.SecurityKit",
4
- "JSBundleVersion": "2024.34.0",
4
+ "JSBundleVersion": "2024.40.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": "61333aba82f5c25a000319a71a75eaed5fa1d713"
12
+ "GitRevision": "f17cafe60642c3c9674095789dec1d1803b72586"
13
13
  }
@@ -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
+ })();