lib/auth/encryption
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
Functions
Section titled “Functions”decrypt()
Section titled “decrypt()”function decrypt(encrypted: Uint8Array): Uint8Array
Defined in: studiocms/packages/studiocms/src/lib/auth/encryption.ts:44
Decrypts the given encrypted data using AES-128-GCM.
Parameters
Section titled “Parameters”encrypted
Section titled “encrypted”Uint8Array
The encrypted data as a Uint8Array. The data must be at least 33 bytes long.
Returns
Section titled “Returns”Uint8Array
The decrypted data as a Uint8Array.
Throws
Section titled “Throws”Will throw an error if the encrypted data is less than 33 bytes.
decryptToString()
Section titled “decryptToString()”function decryptToString(data: Uint8Array): string
Defined in: studiocms/packages/studiocms/src/lib/auth/encryption.ts:62
Decrypts the given Uint8Array data and returns the result as a string.
Parameters
Section titled “Parameters”Uint8Array
The encrypted data as a Uint8Array.
Returns
Section titled “Returns”string
The decrypted data as a string.
encrypt()
Section titled “encrypt()”function encrypt(data: Uint8Array): Uint8Array
Defined in: studiocms/packages/studiocms/src/lib/auth/encryption.ts:15
Encrypts the given data using AES-128-GCM encryption.
Parameters
Section titled “Parameters”Uint8Array
The data to be encrypted as a Uint8Array.
Returns
Section titled “Returns”Uint8Array
The encrypted data as a Uint8Array, which includes the initialization vector (IV), the encrypted content, and the authentication tag.
encryptString()
Section titled “encryptString()”function encryptString(data: string): Uint8Array
Defined in: studiocms/packages/studiocms/src/lib/auth/encryption.ts:33
Encrypts a given string and returns the encrypted data as a Uint8Array.
Parameters
Section titled “Parameters”string
The string to be encrypted.
Returns
Section titled “Returns”Uint8Array
The encrypted data as a Uint8Array.