Class: BrowserVault
THIS VAULT DOES NOT IMPLEMENT SECURE STORAGE IN THE BROWSER. It only exists as a way to run browser-compatible code in place of Identity Vault. Browsers do not have a secure storage element same as native devices. This class is intended to be used to enable running your application in the browser while simulating the functions of Identity Vault using sessionStorage.
Represents a vault implementation for browser compatibility.
Implements
VaultInterface
Constructors
constructor
• new BrowserVault(config?): BrowserVault
Parameters
| Name | Type |
|---|---|
config? | IdentityVaultConfig |
Returns
Usage
_10const vault = new Vault({_10 key: 'com.company.myvaultapp',_10 type: 'CustomPasscode',_10 deviceSecurityType: 'Both',_10 lockAfterBackgrounded: 2000,_10});
Methods
clear
▸ clear(): Promise<void>
See Vault.clear
Returns
Promise<void>
Implementation of
VaultInterface.clear
doesVaultExist
▸ doesVaultExist(): Promise<boolean>
Returns
Promise<boolean>
Implementation of
VaultInterface.doesVaultExist
exportVault
▸ exportVault(): Promise<Record<string, string>>
Returns
Promise<Record<string, string>>
Implementation of
VaultInterface.exportVault
getKeys
▸ getKeys(): Promise<string[]>
See Vault.getKeys
Returns
Promise<string[]>
Implementation of
VaultInterface.getKeys
getValue
▸ getValue<T>(key): Promise<null | T>
See Vault.getValue
Type parameters
| Name | Type |
|---|---|
T | any |
Parameters
| Name | Type |
|---|---|
key | string |
Returns
Promise<null | T>
Implementation of
VaultInterface.getValue
importVault
▸ importVault(data): Promise<void>
Parameters
| Name | Type |
|---|---|
data | Record<string, string> |
Returns
Promise<void>
Implementation of
VaultInterface.importVault
initialize
▸ initialize(config): Promise<void>
Parameters
| Name | Type |
|---|---|
config | IdentityVaultConfig |
Returns
Promise<void>
Usage
_10vault.initialize({_10 key: 'com.company.myvaultapp',_10 type: 'CustomPasscode',_10 deviceSecurityType: 'Both',_10 lockAfterBackgrounded: 2000,_10});
isEmpty
▸ isEmpty(): Promise<boolean>
See Vault.isEmpty
Returns
Promise<boolean>
Implementation of
VaultInterface.isEmpty
isLocked
▸ isLocked(): Promise<boolean>
See Vault.isLocked
Returns
Promise<boolean>
Implementation of
VaultInterface.isLocked
lock
▸ lock(): Promise<void>
See Vault.lock
Returns
Promise<void>
Implementation of
VaultInterface.lock
onConfigChanged
▸ onConfigChanged(callback): void
Parameters
| Name | Type |
|---|---|
callback | Callback<IdentityVaultConfig> |
Returns
void
Implementation of
VaultInterface.onConfigChanged
onError
▸ onError(callback): void
See Vault.onError
Parameters
| Name | Type |
|---|---|
callback | Callback<VaultError> |
Returns
void
Implementation of
VaultInterface.onError
onLock
▸ onLock(callback): void
See Vault.onLock
Parameters
| Name | Type |
|---|---|
callback | Callback<VaultLockEvent> |
Returns
void
Implementation of
VaultInterface.onLock
onPasscodeRequested
▸ onPasscodeRequested(callback): void
Parameters
| Name | Type |
|---|---|
callback | (isPasscodeSetRequest: boolean, onComplete: (code: string) => void) => void |
Returns
void
Implementation of
VaultInterface.onPasscodeRequested
▸ onPasscodeRequested(callback): void
Parameters
| Name | Type |
|---|---|
callback | (isPasscodeSetRequest: boolean) => Promise<void> |
Returns
void
Implementation of
VaultInterface.onPasscodeRequested
onUnlock
▸ onUnlock(callback): void
See Vault.onUnlock
Parameters
| Name | Type |
|---|---|
callback | EmptyCallback |
Returns
void
Implementation of
VaultInterface.onUnlock
removeValue
▸ removeValue(key): Promise<void>
Parameters
| Name | Type |
|---|---|
key | string |
Returns
Promise<void>
Implementation of
VaultInterface.removeValue
setCustomPasscode
▸ setCustomPasscode(passcode): Promise<void>
Parameters
| Name | Type |
|---|---|
passcode | string |
Returns
Promise<void>
Implementation of
VaultInterface.setCustomPasscode
setValue
▸ setValue<T>(key, value): Promise<void>
See Vault.setValue
Type parameters
| Name | Type |
|---|---|
T | any |
Parameters
| Name | Type |
|---|---|
key | string |
value | T |
Returns
Promise<void>
Implementation of
VaultInterface.setValue
unlock
▸ unlock(): Promise<void>
See Vault.unlock
Returns
Promise<void>
Implementation of
VaultInterface.unlock
updateConfig
▸ updateConfig(config): Promise<void>
Parameters
| Name | Type |
|---|---|
config | IdentityVaultConfig |
Returns
Promise<void>
Implementation of
VaultInterface.updateConfig