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

Wrong type definition for export/import Key? #38

Open
theearlofsandwich opened this issue Jan 11, 2025 · 0 comments
Open

Wrong type definition for export/import Key? #38

theearlofsandwich opened this issue Jan 11, 2025 · 0 comments

Comments

@theearlofsandwich
Copy link

Describe the bug
The typescript definitions for import and export AES key specify it should be one of 'pkcs8' | 'spki' | 'raw'
However, it looks like pkcs8 and spki are not valid and it should be 'raw' or 'jwk'

To Reproduce
const x = exportKey( myKey, 'pkcs8'); < doesn't work, throwing wrong type of key error

const x = exportKey( myKey, 'jwk'); < works great

More info
Line 125 of web-crypto.d.ts (& line 117)
declare const exportKey: (key: CryptoKey, type?: 'pkcs8' | 'spki' | 'raw') => Promise;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant