-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcrypto_key.ts
33 lines (31 loc) · 910 Bytes
/
crypto_key.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { AesKeyGenParams } from "./aes/mod.ts";
import { RsaHashedKeyGenParams } from "./rsa/mod.ts";
import { EcKeyGenParams } from "./ec/mod.ts";
import { HmacKeyGenParams } from "./hmac/mod.ts";
export type Usage =
| "encrypt"
| "decrypt"
| "sign"
| "verify"
| "deriveKey"
| "deriveBits"
| "wrapKey"
| "unwrapKey";
/**
* The CryptoKey interface of the Web Crypto API represents a cryptographic key obtained from
* one of the SubtleCrypto methods generateKey(), deriveKey(), importKey(), or unwrapKey().
*
* For security reasons, the CryptoKey interface can only be used in a secure context.
*
* https://developer.mozilla.org/en-US/docs/Web/API/CryptoKey
*/
export interface CryptoKey {
type: "secret" | "private" | "public";
extractable: boolean;
algorithm:
| AesKeyGenParams
| RsaHashedKeyGenParams
| EcKeyGenParams
| HmacKeyGenParams;
usages: Usage[];
}