SafeStorage

external interface SafeStorage(source)

Functions

Link copied to clipboard
abstract external fun decryptString(encrypted: Buffer<*>): String

the decrypted string. Decrypts the encrypted buffer obtained with safeStorage.encryptString back into a string.

Link copied to clipboard
abstract external fun decryptStringAsync(encrypted: Buffer<*>): Promise<DecryptStringAsyncReturnValue>

Resolve with an object containing the following:

Link copied to clipboard
abstract external fun encryptString(plainText: String): Buffer<*>

An array of bytes representing the encrypted string.

Link copied to clipboard
abstract external fun encryptStringAsync(plainText: String): Promise<Buffer<*>>

An array of bytes representing the encrypted string.

Link copied to clipboard

User friendly name of the password manager selected on Linux.

Link copied to clipboard
abstract external fun isAsyncEncryptionAvailable(): Promise<Boolean>

Whether encryption is available for asynchronous safeStorage operations.

Link copied to clipboard
abstract external fun isEncryptionAvailable(): Boolean

Whether encryption is available.

Link copied to clipboard
abstract external fun setUsePlainTextEncryption(usePlainText: Boolean)

This function on Linux will force the module to use an in memory password for creating symmetric key that is used for encrypt/decrypt functions when a valid OS password manager cannot be determined for the current active desktop environment. This function is a no-op on Windows and MacOS.