diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2021-08-29 17:53:51 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-29 14:23:51 +0200 |
commit | 5ee211017912bc0837cbce3b845e6ab4a7887885 (patch) | |
tree | 8f71f0dff5013e422f56e61e5b1623d29a3fd0f8 /ext/crypto/lib.deno_crypto.d.ts | |
parent | 8a097410a8df3195681305818035ab7dde41452b (diff) |
feat(ext/crypto): support JWK export for HMAC (#11864)
Diffstat (limited to 'ext/crypto/lib.deno_crypto.d.ts')
-rw-r--r-- | ext/crypto/lib.deno_crypto.d.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ext/crypto/lib.deno_crypto.d.ts b/ext/crypto/lib.deno_crypto.d.ts index 2e8d2f8b2..5169e5c3b 100644 --- a/ext/crypto/lib.deno_crypto.d.ts +++ b/ext/crypto/lib.deno_crypto.d.ts @@ -25,7 +25,7 @@ type KeyUsage = | "unwrapKey" | "verify" | "wrapKey"; - +type KeyFormat = "jwk" | "pkcs8" | "raw" | "spki"; type NamedCurve = string; interface RsaOtherPrimesInfo { @@ -164,7 +164,11 @@ interface SubtleCrypto { extractable: boolean, keyUsages: KeyUsage[], ): Promise<CryptoKey>; - exportKey(format: "raw", key: CryptoKey): Promise<ArrayBuffer>; + exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>; + exportKey( + format: Exclude<KeyFormat, "jwk">, + key: CryptoKey, + ): Promise<ArrayBuffer>; sign( algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams, key: CryptoKey, |