From b53145ffed086ab7f5f059c3cfc345623f52ddf1 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Tue, 17 Aug 2021 06:46:37 +0000 Subject: [PATCH 1/4] fix(ext/crypto): KeyAlgorithm typings for supported algorithms --- ext/crypto/lib.deno_crypto.d.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ext/crypto/lib.deno_crypto.d.ts b/ext/crypto/lib.deno_crypto.d.ts index b89b62f2eccd22..516d42ed72bed3 100644 --- a/ext/crypto/lib.deno_crypto.d.ts +++ b/ext/crypto/lib.deno_crypto.d.ts @@ -59,6 +59,24 @@ interface HmacImportParams extends Algorithm { length?: number; } +interface EcKeyAlgorithm extends KeyAlgorithm { + namedCurve: NamedCurve; +} + +interface HmacKeyAlgorithm extends KeyAlgorithm { + hash: KeyAlgorithm; + length: number; +} + +interface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm { + hash: KeyAlgorithm; +} + +interface RsaKeyAlgorithm extends KeyAlgorithm { + modulusLength: number; + publicExponent: BigInteger; +} + /** The CryptoKey dictionary of the Web Crypto API represents a cryptographic key. */ interface CryptoKey { readonly algorithm: KeyAlgorithm; From 71604cce11ef4bd5f136b9ae95da2015fcfbbc5d Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Tue, 17 Aug 2021 06:56:46 +0000 Subject: [PATCH 2/4] BigInteger type --- ext/crypto/lib.deno_crypto.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/ext/crypto/lib.deno_crypto.d.ts b/ext/crypto/lib.deno_crypto.d.ts index 516d42ed72bed3..d1501125c49648 100644 --- a/ext/crypto/lib.deno_crypto.d.ts +++ b/ext/crypto/lib.deno_crypto.d.ts @@ -27,6 +27,7 @@ type KeyUsage = | "wrapKey"; type NamedCurve = string; +type BigInteger = Uint8Array; interface HmacKeyGenParams extends Algorithm { hash: HashAlgorithmIdentifier; From 2aee528c5e38b3bc71e20664991c0db3d51a12fd Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Tue, 17 Aug 2021 09:54:40 +0000 Subject: [PATCH 3/4] fix --- ext/crypto/lib.deno_crypto.d.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ext/crypto/lib.deno_crypto.d.ts b/ext/crypto/lib.deno_crypto.d.ts index d1501125c49648..b65a6aa2e279af 100644 --- a/ext/crypto/lib.deno_crypto.d.ts +++ b/ext/crypto/lib.deno_crypto.d.ts @@ -27,7 +27,6 @@ type KeyUsage = | "wrapKey"; type NamedCurve = string; -type BigInteger = Uint8Array; interface HmacKeyGenParams extends Algorithm { hash: HashAlgorithmIdentifier; @@ -75,7 +74,7 @@ interface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm { interface RsaKeyAlgorithm extends KeyAlgorithm { modulusLength: number; - publicExponent: BigInteger; + publicExponent: Uint8Array; } /** The CryptoKey dictionary of the Web Crypto API represents a cryptographic key. */ From b7451139004b96b46eb78253b2fd52a242d2e017 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Tue, 17 Aug 2021 10:07:05 +0000 Subject: [PATCH 4/4] re run CI