diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2021-08-27 16:49:41 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-27 13:19:41 +0200 |
commit | 1f57cd2c0f0d7d9020fc2667bb7b1af54822ceb2 (patch) | |
tree | de8885655c030ec079bd1c28344e7815ad2906c9 /ext/crypto/lib.deno_crypto.d.ts | |
parent | ad037b3b1a30dd02d9ac5a8fbd54fd200029b014 (diff) |
feat(ext/crypto): support JWK import for HMAC (#11716)
Diffstat (limited to 'ext/crypto/lib.deno_crypto.d.ts')
-rw-r--r-- | ext/crypto/lib.deno_crypto.d.ts | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/ext/crypto/lib.deno_crypto.d.ts b/ext/crypto/lib.deno_crypto.d.ts index 6b1901611..2e8d2f8b2 100644 --- a/ext/crypto/lib.deno_crypto.d.ts +++ b/ext/crypto/lib.deno_crypto.d.ts @@ -28,6 +28,34 @@ type KeyUsage = type NamedCurve = string; +interface RsaOtherPrimesInfo { + d?: string; + r?: string; + t?: string; +} + +interface JsonWebKey { + alg?: string; + crv?: string; + d?: string; + dp?: string; + dq?: string; + e?: string; + ext?: boolean; + k?: string; + // deno-lint-ignore camelcase + key_ops?: string[]; + kty?: string; + n?: string; + oth?: RsaOtherPrimesInfo[]; + p?: string; + q?: string; + qi?: string; + use?: string; + x?: string; + y?: string; +} + interface HmacKeyGenParams extends Algorithm { hash: HashAlgorithmIdentifier; length?: number; @@ -123,6 +151,13 @@ interface SubtleCrypto { keyUsages: KeyUsage[], ): Promise<CryptoKeyPair | CryptoKey>; importKey( + format: "jwk", + keyData: JsonWebKey, + algorithm: AlgorithmIdentifier | HmacImportParams, + extractable: boolean, + keyUsages: KeyUsage[], + ): Promise<CryptoKey>; + importKey( format: "raw", keyData: BufferSource, algorithm: AlgorithmIdentifier | HmacImportParams, |