Commit 6cc4cf8
crypto: unify asymmetric key import through KeyObjectHandle::Init
Consolidate all asymmetric key import paths (DER/PEM, JWK, raw) into
a single KeyObjectHandle::Init() entry point with a uniform signature.
Remove the per-type C++ init methods (InitECRaw, InitEDRaw, InitPqcRaw,
InitJwk, InitECPrivateRaw) and their JS-side callers, replacing them
with shared C++ and JS helpers.
createPublicKey, createPrivateKey, sign, verify, and other operations
that accept key material now handle JWK and raw formats directly in
C++, removing redundant JS-to-C++ key handle round-trips.
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: #62499
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>1 parent b81d2cb commit 6cc4cf8Copy full SHA for 6cc4cf8
25 files changed
+929-1,065Lines changed: 929 additions & 1065 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- lib/internal/crypto
- src/crypto
- test/parallel
Expand file treeCollapse file tree
Open diff view settings
Collapse file
+8-23Lines changed: 8 additions & 23 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
10 | 10 | |
11 | 11 | |
12 | 12 | |
| 13 | + |
| 14 | + |
13 | 15 | |
14 | 16 | |
15 | 17 | |
| ||
30 | 32 | |
31 | 33 | |
32 | 34 | |
33 | | - |
34 | 35 | |
35 | 36 | |
36 | 37 | |
| ||
47 | 48 | |
48 | 49 | |
49 | 50 | |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | + |
50 | 55 | |
51 | 56 | |
52 | 57 | |
| ||
245 | 250 | |
246 | 251 | |
247 | 252 | |
248 | | - |
249 | | - |
250 | | - |
251 | | - |
252 | | - |
253 | | - |
254 | | - |
255 | | - |
256 | | - |
257 | | - |
258 | | - |
259 | | - |
260 | | - |
261 | | - |
262 | | - |
263 | | - |
264 | | - |
265 | | - |
266 | | - |
267 | | - |
268 | | - |
| 253 | + |
269 | 254 | |
270 | 255 | |
271 | 256 | |
272 | | - |
| 257 | + |
273 | 258 | |
274 | 259 | |
275 | 260 | |
|
Collapse file
lib/internal/crypto/cfrg.js
Copy file name to clipboardExpand all lines: lib/internal/crypto/cfrg.js+20-137Lines changed: 20 additions & 137 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
6 | 6 | |
7 | 7 | |
8 | 8 | |
9 | | - |
10 | | - |
11 | 9 | |
12 | | - |
13 | 10 | |
14 | 11 | |
15 | 12 | |
16 | | - |
17 | | - |
| 13 | + |
18 | 14 | |
19 | 15 | |
20 | 16 | |
21 | 17 | |
22 | 18 | |
23 | 19 | |
24 | 20 | |
25 | | - |
26 | | - |
27 | | - |
28 | | - |
29 | | - |
30 | | - |
31 | 21 | |
32 | 22 | |
33 | 23 | |
34 | 24 | |
35 | | - |
36 | 25 | |
37 | 26 | |
38 | 27 | |
| ||
48 | 37 | |
49 | 38 | |
50 | 39 | |
51 | | - |
52 | | - |
53 | | - |
54 | | - |
55 | 40 | |
56 | 41 | |
57 | 42 | |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
58 | 50 | |
59 | 51 | |
60 | 52 | |
| ||
81 | 73 | |
82 | 74 | |
83 | 75 | |
84 | | - |
85 | | - |
86 | | - |
87 | | - |
88 | | - |
89 | | - |
90 | | - |
91 | | - |
92 | | - |
93 | | - |
94 | | - |
95 | | - |
96 | | - |
97 | | - |
98 | | - |
99 | | - |
100 | | - |
101 | | - |
102 | | - |
103 | | - |
104 | | - |
105 | | - |
106 | | - |
107 | | - |
108 | | - |
109 | | - |
110 | | - |
111 | | - |
112 | | - |
113 | | - |
114 | | - |
115 | | - |
116 | | - |
117 | 76 | |
118 | 77 | |
119 | 78 | |
| ||
243 | 202 | |
244 | 203 | |
245 | 204 | |
246 | | - |
247 | | - |
248 | | - |
249 | | - |
250 | | - |
251 | | - |
252 | | - |
253 | | - |
254 | | - |
255 | | - |
| 205 | + |
256 | 206 | |
257 | 207 | |
258 | 208 | |
259 | 209 | |
260 | | - |
261 | | - |
262 | | - |
263 | | - |
264 | | - |
265 | | - |
266 | | - |
267 | | - |
268 | | - |
269 | | - |
| 210 | + |
270 | 211 | |
271 | 212 | |
272 | 213 | |
273 | | - |
274 | | - |
275 | | - |
276 | | - |
| 214 | + |
| 215 | + |
| 216 | + |
277 | 217 | |
278 | 218 | |
279 | 219 | |
280 | | - |
281 | | - |
282 | | - |
283 | | - |
284 | | - |
285 | | - |
286 | | - |
287 | | - |
288 | | - |
289 | | - |
290 | | - |
291 | | - |
292 | | - |
293 | | - |
294 | | - |
295 | | - |
296 | | - |
297 | | - |
298 | | - |
299 | | - |
300 | | - |
301 | | - |
302 | | - |
303 | | - |
304 | | - |
305 | | - |
306 | | - |
307 | | - |
308 | | - |
309 | 220 | |
310 | 221 | |
311 | | - |
| 222 | + |
312 | 223 | |
313 | | - |
314 | | - |
315 | | - |
| 224 | + |
316 | 225 | |
317 | 226 | |
318 | | - |
319 | | - |
320 | | - |
321 | | - |
322 | | - |
323 | | - |
324 | | - |
325 | | - |
326 | | - |
327 | | - |
328 | | - |
329 | | - |
330 | | - |
331 | | - |
332 | | - |
333 | | - |
334 | | - |
335 | | - |
336 | | - |
337 | | - |
338 | | - |
339 | | - |
340 | | - |
341 | | - |
342 | | - |
343 | | - |
344 | | - |
345 | | - |
346 | | - |
347 | | - |
| 227 | + |
| 228 | + |
| 229 | + |
348 | 230 | |
349 | 231 | |
350 | 232 | |
351 | 233 | |
352 | | - |
| 234 | + |
353 | 235 | |
354 | 236 | |
355 | 237 | |
| ||
381 | 263 | |
382 | 264 | |
383 | 265 | |
| 266 | + |
384 | 267 | |
385 | 268 | |
386 | 269 | |
|
Collapse file
lib/internal/crypto/chacha20_poly1305.js
Copy file name to clipboardExpand all lines: lib/internal/crypto/chacha20_poly1305.js+8-23Lines changed: 8 additions & 23 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
9 | 9 | |
10 | 10 | |
11 | 11 | |
| 12 | + |
| 13 | + |
12 | 14 | |
13 | 15 | |
14 | 16 | |
15 | 17 | |
16 | 18 | |
17 | | - |
18 | 19 | |
19 | 20 | |
20 | 21 | |
| ||
30 | 31 | |
31 | 32 | |
32 | 33 | |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
33 | 38 | |
34 | 39 | |
35 | 40 | |
| ||
107 | 112 | |
108 | 113 | |
109 | 114 | |
110 | | - |
111 | | - |
112 | | - |
113 | | - |
114 | | - |
115 | | - |
116 | | - |
117 | | - |
118 | | - |
119 | | - |
120 | | - |
121 | | - |
122 | | - |
123 | | - |
124 | | - |
125 | | - |
126 | | - |
127 | | - |
128 | | - |
129 | | - |
130 | | - |
| 115 | + |
131 | 116 | |
132 | 117 | |
133 | 118 | |
134 | | - |
| 119 | + |
135 | 120 | |
136 | 121 | |
137 | 122 | |
|
Collapse file
lib/internal/crypto/cipher.js
Copy file name to clipboardExpand all lines: lib/internal/crypto/cipher.js+3-3Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
64 | 64 | |
65 | 65 | |
66 | 66 | |
67 | | - |
| 67 | + |
68 | 68 | |
69 | 69 | |
70 | 70 | |
| ||
76 | 76 | |
77 | 77 | |
78 | 78 | |
79 | | - |
80 | | - |
| 79 | + |
| 80 | + |
81 | 81 | |
82 | 82 | |
83 | 83 | |
|
0 commit comments