Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(crypto): Initial support for SubtleCrypto #698

Merged
merged 66 commits into from
Dec 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
1f05eca
feat(crypto): Initial support for SubtleCrypto
nabetti1720 Nov 23, 2024
1e817b1
Refactor extract logic
nabetti1720 Nov 23, 2024
ed9fee5
Asynchronous support and tiny fix
nabetti1720 Nov 24, 2024
18a0b44
Refactor arguments and return values
nabetti1720 Nov 24, 2024
e29ae54
Refactor argument names
nabetti1720 Nov 24, 2024
dc393a3
Use ObjectBytes
nabetti1720 Nov 25, 2024
0b2388e
Refactor Error Handling
nabetti1720 Nov 25, 2024
9ddf393
Fix
nabetti1720 Nov 25, 2024
4842803
Use common SYSTEM_RANDOM
nabetti1720 Nov 25, 2024
d21ec7e
Refactor
nabetti1720 Nov 25, 2024
76e44a3
Remove unnecessary to_vec()
nabetti1720 Nov 25, 2024
0350de2
Remove more unnecessary to_vec()
nabetti1720 Nov 25, 2024
ad57a02
Optimize ArrayBuffer arguments
nabetti1720 Nov 25, 2024
8ba513b
chore
nabetti1720 Nov 26, 2024
2cb91d5
Implement try_into() for enums
nabetti1720 Nov 26, 2024
e2289d1
Refactor the structure
nabetti1720 Nov 26, 2024
1fa377d
Fix error messages
nabetti1720 Nov 26, 2024
36b12fb
Refactor
nabetti1720 Nov 26, 2024
930dff4
Create CryptoKey Object
nabetti1720 Nov 26, 2024
ee89186
Fix
nabetti1720 Nov 26, 2024
6d96cd6
Refactor generateKey
nabetti1720 Nov 27, 2024
75601b8
Expose CryptoKey and CryptoKeyPair
nabetti1720 Nov 27, 2024
1f113a0
Create CryptoKeyPair class
nabetti1720 Nov 28, 2024
493858e
Fix error messages
nabetti1720 Nov 28, 2024
967da3d
Implement classify_and_check_usages
nabetti1720 Nov 28, 2024
b88eaf1
Separate CryptoKeyPair constructor
nabetti1720 Nov 28, 2024
d20c558
Refactor classify_and_check_usages (But still incomplete)
nabetti1720 Nov 29, 2024
aad3846
Fix handle type
nabetti1720 Nov 29, 2024
7cbd45f
Use HashSet::with_capacity()
nabetti1720 Nov 29, 2024
c406546
Expose exportKey()
nabetti1720 Nov 29, 2024
79c68a9
Refactor
nabetti1720 Nov 30, 2024
a0ee48a
Modify arguments
nabetti1720 Nov 30, 2024
9193f7b
Fix publicExponent processing
nabetti1720 Nov 30, 2024
77976e8
Fix CryptoKeyPair structure
nabetti1720 Nov 30, 2024
78f5d16
Check supported usage
nabetti1720 Nov 30, 2024
a13e996
Exposet importKey()
nabetti1720 Nov 30, 2024
b3ebd37
Fix parameter processing
nabetti1720 Nov 30, 2024
4670509
Fix extraction process in DeriveAlgorithm::Edch
nabetti1720 Nov 30, 2024
1d566ab
Refactor
nabetti1720 Nov 30, 2024
28abddc
Refactor
nabetti1720 Nov 30, 2024
3204e7f
Add test digest()
nabetti1720 Nov 30, 2024
45d8497
Refactor digest()
nabetti1720 Nov 30, 2024
4adfb91
Remove hmac, sha1 and sha2 crate
nabetti1720 Nov 30, 2024
a553793
chore
nabetti1720 Nov 30, 2024
c7215e6
Refactor
nabetti1720 Nov 30, 2024
67e347e
Add extractable check
nabetti1720 Nov 30, 2024
c7c13f1
Remove CryptoKeyPair object
nabetti1720 Dec 1, 2024
6c186be
Add test generateKey()
nabetti1720 Dec 1, 2024
f6e2009
Fix AES-KW checking
nabetti1720 Dec 1, 2024
d0d5fe8
Modify test code
nabetti1720 Dec 1, 2024
43cd316
Fix CryptoKeyPair to be enumerable
nabetti1720 Dec 1, 2024
f061026
Refactor
nabetti1720 Dec 3, 2024
a7c6936
Fix and refactor encrypt/decrypt
nabetti1720 Dec 3, 2024
1025fe6
Add test and refactor
nabetti1720 Dec 4, 2024
dd54a0e
Add types
nabetti1720 Dec 4, 2024
c9762f2
Edit API.md
nabetti1720 Dec 4, 2024
04d103c
Fix AES-CTR encrypt/decrypt
nabetti1720 Dec 4, 2024
45fab48
Support Ed25519
nabetti1720 Dec 4, 2024
3f538e6
Remove num-traits crate
nabetti1720 Dec 5, 2024
f985a21
Remove num-traits crate
nabetti1720 Dec 5, 2024
7913897
Cleanup mod, remove clone, throw error if string conversion fails
richarddavison Dec 6, 2024
6bd83c6
Refactor
richarddavison Dec 11, 2024
bfb08d9
Merge branch 'main' into feat/subtle-crypto
richarddavison Dec 12, 2024
1f0e345
Refactor and fix usage validation
richarddavison Dec 13, 2024
1fcaeab
Remove unused code
richarddavison Dec 13, 2024
9361150
Keep importKey private until fixed
nabetti1720 Dec 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"AWS_SECRET_ACCESS_KEY": "",
"AWS_SESSION_TOKEN": ""
},
"args": [],
"args": ["index.mjs"],
"cwd": "${workspaceFolder}"
},
{
Expand Down
20 changes: 20 additions & 0 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,26 @@ Everything else inherited from [Uint8Array](https://developer.mozilla.org/en-US/

[randomUUID](https://nodejs.org/api/crypto.html#cryptorandomuuidoptions)

## crypto.subtle

[subtle.decrypt](https://nodejs.org/api/webcrypto.html#subtledecryptalgorithm-key-data)

[subtle.deriveBits](https://nodejs.org/api/webcrypto.html#subtlederivebitsalgorithm-basekey-length)

[subtle.digest](https://nodejs.org/api/webcrypto.html#subtledigestalgorithm-data)

[subtle.encrypt](https://nodejs.org/api/webcrypto.html#subtleencryptalgorithm-key-data)

[subtle.exportKey](hthttps://nodejs.org/api/webcrypto.html#subtleexportkeyformat-key)

[subtle.generateKey](https://nodejs.org/api/webcrypto.html#subtlegeneratekeyalgorithm-extractable-keyusages)

[subtle.importKey](https://nodejs.org/api/webcrypto.html#subtleimportkeyformat-keydata-algorithm-extractable-keyusages)

[subtle.sign](https://nodejs.org/api/webcrypto.html#subtlesignalgorithm-key-data)

[subtle.verify](hthttps://nodejs.org/api/webcrypto.html#subtleverifyalgorithm-key-signature-datah)

## events

[EventEmitter](https://nodejs.org/api/events.html#class-eventemitter)
Expand Down
Loading
Loading