lib/auth/encryption
Functions
'Read the “', Functions, '” section'decrypt()
'Read the “', decrypt(), '” section'function decrypt(encrypted: Uint8Array): Uint8Array
Defined in: studiocms/packages/studiocms/src/lib/auth/encryption.ts:45
Decrypts the given encrypted data using AES-128-GCM.
Parameters
'Read the “', Parameters, '” section'encrypted
'Read the “', encrypted, '” section'Uint8Array
The encrypted data as a Uint8Array. The data must be at least 33 bytes long.
Uint8Array
The decrypted data as a Uint8Array.
Will throw an error if the encrypted data is less than 33 bytes.
decryptToString()
'Read the “', decryptToString(), '” section'function decryptToString(data: Uint8Array): string
Defined in: studiocms/packages/studiocms/src/lib/auth/encryption.ts:63
Decrypts the given Uint8Array data and returns the result as a string.
Parameters
'Read the “', Parameters, '” section'Uint8Array
The encrypted data as a Uint8Array.
string
The decrypted data as a string.
encrypt()
'Read the “', encrypt(), '” section'function encrypt(data: Uint8Array): Uint8Array
Defined in: studiocms/packages/studiocms/src/lib/auth/encryption.ts:16
Encrypts the given data using AES-128-GCM encryption.
Parameters
'Read the “', Parameters, '” section'Uint8Array
The data to be encrypted as a Uint8Array.
Uint8Array
The encrypted data as a Uint8Array, which includes the initialization vector (IV), the encrypted content, and the authentication tag.
encryptString()
'Read the “', encryptString(), '” section'function encryptString(data: string): Uint8Array
Defined in: studiocms/packages/studiocms/src/lib/auth/encryption.ts:34
Encrypts a given string and returns the encrypted data as a Uint8Array.
Parameters
'Read the “', Parameters, '” section'string
The string to be encrypted.
Uint8Array
The encrypted data as a Uint8Array.