summaryrefslogtreecommitdiff
path: root/ext/crypto/lib.deno_crypto.d.ts
diff options
context:
space:
mode:
Diffstat (limited to 'ext/crypto/lib.deno_crypto.d.ts')
-rw-r--r--ext/crypto/lib.deno_crypto.d.ts35
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,