KeychainBrowser

KeychainBrowser

An empty Keychain implementation for browsers

It exists only to provide an equivalent class to node.

Constructor

new KeychainBrowser(service, account)

Description:
  • Create an empty Keychain implementation
Source:
Since:
  • 0.1.0
Example
// Import this class as `Keychain`.
// If you use a bundler such as Webpack, `KeychainBrowser` will be automatically selected.
import { Keychain } from '@pinemz/safe-storage'

const keychain = new Keychain('service', 'account')
console.log(await keychain.getPassword()) // throws Error
Parameters:
Name Type Description
service string The service name
account string The account name

Methods

(async) getOrCreatePassword() → {Promise.<string>}

Description:
  • Browser not supported, always fails to run
Source:
Since:
  • 0.1.0
Returns:
Promise that is always rejected
Type
Promise.<string>

(async) getPassword() → {Promise.<(string|null)>}

Description:
  • Browser not supported, always fails to run
Source:
Since:
  • 0.1.0
Returns:
Promise that is always rejected
Type
Promise.<(string|null)>