Skip to content

Commit 56f8dde

Browse files
jsocolguybedford
andauthored
Add EcKeyImportParams to SubtleCrypto.importKey (#769)
Co-authored-by: Guy Bedford <[email protected]>
1 parent d0eb82d commit 56f8dde

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

types/globals.d.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1705,7 +1705,7 @@ declare class SubtleCrypto {
17051705
// generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
17061706
// generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>;
17071707
// importKey(format: "jwk", keyData: JsonWebKey, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
1708-
importKey(format: "jwk", keyData: JsonWebKey, algorithm: AlgorithmIdentifier | RsaHashedImportParams, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
1708+
importKey(format: "jwk", keyData: JsonWebKey, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
17091709
importKey(
17101710
format: Exclude<KeyFormat, "jwk">,
17111711
keyData: BufferSource,
@@ -1734,6 +1734,11 @@ interface RsaHashedImportParams extends Algorithm {
17341734
}
17351735
type HashAlgorithmIdentifier = AlgorithmIdentifier;
17361736

1737+
interface EcKeyImportParams {
1738+
name: "ECDSA";
1739+
namedCurve: "P-256" | "P-384" | "P-521";
1740+
}
1741+
17371742
interface JsonWebKey {
17381743
alg?: string;
17391744
crv?: string;

0 commit comments

Comments
 (0)