Skip to content

Wrong type definition for export/import Key? #38

@theearlofsandwich

Description

@theearlofsandwich

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;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions