ElectronSafeStorage
Unofficial
Electron safeStorage module for encrypting and decrypting strings using OS-level cryptography.
Import:
import type { ElectronSafeStorage } from '@obsidian-typings/obsidian-public-latest';Signature:
export interface ElectronSafeStorage extends NodeJS.EventEmitterExtends: NodeJS.EventEmitter
Methods
| Method | Returns | Description | |
|---|---|---|---|
| decryptString(encrypted) | string | Decrypts the encrypted buffer obtained with encryptString back into a string.This function will throw an error if decryption fails. | |
| encryptString(plainText) | Buffer | Encrypts a string using OS-level cryptography. This function will throw an error if encryption fails. | |
| isEncryptionAvailable() | boolean | Whether encryption is available. On Linux, returns true if the app has emitted the ready event and the secret key is available. On macOS, returns true if Keychain is available. On Windows, returns true once the app has emitted the ready event. |
Links to this page: