Interface EncryptedStorageManager

interface EncryptedStorageManager {
    delete(key: string): boolean;
    get(key: string, password: string): Promise<null | string>;
    has(key: string): boolean;
    set(key: string, value: string, password: string): Promise<boolean>;
}

Methods

Methods

  • Deletes the encrypted value associated with the key.

    Parameters

    • key: string

    Returns boolean

    true if the key was deleted, or false if the key didn't exist.

  • Retrieves an encrypted value associated with the key.

    Parameters

    • key: string
    • password: string

    Returns Promise<null | string>

    The deciphered value, or null if key wasn't found or if password is incorrect.

  • Returns true if the key exists in the storage, or false otherwise.

    Parameters

    • key: string

    Returns boolean

  • Associates a value with a key in an encrypted storage.

    Parameters

    • key: string

      A key to set.

    • value: string

      A value to write.

    • password: string

      The password that is used to cipher the value.

    Returns Promise<boolean>

    true if the value was written to the storage, or false otherwise.