encryptKeyTo( __namedParameters: { key: string | Uint8Array<ArrayBufferLike> | CryptoKey; publicKey: string | Uint8Array<ArrayBufferLike> | CryptoKey; }, format: "arraybuffer",): Promise<ArrayBuffer> Parameters
- __namedParameters: {
key: string | Uint8Array<ArrayBufferLike> | CryptoKey;
publicKey: string | Uint8Array<ArrayBufferLike> | CryptoKey;
} - format: "arraybuffer"
Returns Promise<ArrayBuffer>
encryptKeyTo( __namedParameters: { key: string | Uint8Array<ArrayBufferLike> | CryptoKey; publicKey: string | Uint8Array<ArrayBufferLike> | CryptoKey; }, format: "uint8array",): Promise<Uint8Array<ArrayBufferLike>> Parameters
- __namedParameters: {
key: string | Uint8Array<ArrayBufferLike> | CryptoKey;
publicKey: string | Uint8Array<ArrayBufferLike> | CryptoKey;
} - format: "uint8array"
Returns Promise<Uint8Array<ArrayBufferLike>>
encryptKeyTo( __namedParameters: { key: string | Uint8Array<ArrayBufferLike> | CryptoKey; publicKey: string | Uint8Array<ArrayBufferLike> | CryptoKey; }, format?: undefined,): Promise<Uint8Array<ArrayBufferLike>> Parameters
- __namedParameters: {
key: string | Uint8Array<ArrayBufferLike> | CryptoKey;
publicKey: string | Uint8Array<ArrayBufferLike> | CryptoKey;
} Optional
format: undefined
Returns Promise<Uint8Array<ArrayBufferLike>>
Methods
asString
asString( __namedParameters: { key: string | Uint8Array<ArrayBufferLike> | CryptoKey; publicKey: string | Uint8Array<ArrayBufferLike> | CryptoKey; }, format?: SupportedEncodings,): Promise<string> Parameters
- __namedParameters: {
key: string | Uint8Array<ArrayBufferLike> | CryptoKey;
publicKey: string | Uint8Array<ArrayBufferLike> | CryptoKey;
} Optional
format: SupportedEncodings
Returns Promise<string>
Encrypt the given content to the given public key. This is RSA encryption, and should be used only to encrypt AES keys.
Param: params
The content to encrypt, and public key to encrypt it to.
Returns