Skip to Content
SdkReactInternalFunctionsencryptDataWithKey

encryptDataWithKey

encryptDataWithKey(plaintext: string | Uint8Array<ArrayBufferLike>, key: CryptoKey): Promise<string>

Defined in: src/react/useEncryption.ts:555 

Internal

Encrypts data using a pre-fetched CryptoKey. Use this for batch operations to avoid repeated key lookups.

Parameters

ParameterTypeDescription

plaintext

string | Uint8Array<ArrayBufferLike>

The data to encrypt (string or Uint8Array)

key

CryptoKey

The CryptoKey for AES-GCM encryption

Returns

Promise<string>

Encrypted data as hex string (IV + ciphertext + auth tag)

Last updated on