AES: {
encrypt: {
(
data: Uint8Array,
cryptoKey: Uint8Array<ArrayBufferLike> | CryptoKey,
format?: undefined,
iv?: Uint8Array<ArrayBufferLike>,
): Promise<Uint8Array<ArrayBufferLike>>;
(
data: Uint8Array,
cryptoKey: Uint8Array<ArrayBufferLike> | CryptoKey,
format: "uint8array",
iv?: Uint8Array<ArrayBufferLike>,
): Promise<Uint8Array<ArrayBufferLike>>;
(
data: Uint8Array,
cryptoKey: Uint8Array<ArrayBufferLike> | CryptoKey,
format: "arraybuffer",
iv?: Uint8Array<ArrayBufferLike>,
): Promise<ArrayBuffer>;
};
export: (key: CryptoKey) => Promise<Uint8Array<ArrayBufferLike>> & {
asString: (
key: CryptoKey,
format?: SupportedEncodings,
) => Promise<string>;
};
create(opts?: { alg: string; length: number }): Promise<CryptoKey>;
decrypt(
encryptedData: string | ArrayBuffer | Uint8Array<ArrayBufferLike>,
cryptoKey: ArrayBuffer | Uint8Array<ArrayBufferLike> | CryptoKey,
iv?: Uint8Array<ArrayBufferLike>,
): Promise<Uint8Array<ArrayBufferLike>>;
exportAsString(key: CryptoKey): Promise<string>;
import(key: string | Uint8Array<ArrayBufferLike>): Promise<CryptoKey>;
} = ...
Type declaration
encrypt: {
(
data: Uint8Array,
cryptoKey: Uint8Array<ArrayBufferLike> | CryptoKey,
format?: undefined,
iv?: Uint8Array<ArrayBufferLike>,
): Promise<Uint8Array<ArrayBufferLike>>;
(
data: Uint8Array,
cryptoKey: Uint8Array<ArrayBufferLike> | CryptoKey,
format: "uint8array",
iv?: Uint8Array<ArrayBufferLike>,
): Promise<Uint8Array<ArrayBufferLike>>;
(
data: Uint8Array,
cryptoKey: Uint8Array<ArrayBufferLike> | CryptoKey,
format: "arraybuffer",
iv?: Uint8Array<ArrayBufferLike>,
): Promise<ArrayBuffer>;
}
export: (key: CryptoKey) => Promise<Uint8Array<ArrayBufferLike>> & {
asString: (
key: CryptoKey,
format?: SupportedEncodings,
) => Promise<string>;
}
create:function
create(opts?: { alg: string; length: number }): Promise<CryptoKey> Parameters
- opts: { alg: string; length: number } = ...
Returns Promise<CryptoKey>
decrypt:function
decrypt( encryptedData: string | ArrayBuffer | Uint8Array<ArrayBufferLike>, cryptoKey: ArrayBuffer | Uint8Array<ArrayBufferLike> | CryptoKey, iv?: Uint8Array<ArrayBufferLike>,): Promise<Uint8Array<ArrayBufferLike>> Parameters
- encryptedData: string | ArrayBuffer | Uint8Array<ArrayBufferLike>
- cryptoKey: ArrayBuffer | Uint8Array<ArrayBufferLike> | CryptoKey
Optional
iv: Uint8Array<ArrayBufferLike>
Returns Promise<Uint8Array<ArrayBufferLike>>
exportAsString:function
exportAsString(key: CryptoKey): Promise<string>
import:function
import(key: string | Uint8Array<ArrayBufferLike>): Promise<CryptoKey> Parameters
- key: string | Uint8Array<ArrayBufferLike>
Returns Promise<CryptoKey>