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.
Constructors
constructor
Usage
_10const vault = new Vault({_10 key: 'com.company.myvaultapp',_10 type: 'CustomPasscode',_10 deviceSecurityType: 'Both',_10 lockAfterBackgrounded: 2000,_10});
Parameters
Name | Type |
---|---|
config? | IdentityVaultConfig |
Returns: BrowserVault
Methods
clear
See Vault.clear
Returns: Promise<void>
doesVaultExist
Returns: Promise<boolean>
exportVault
Returns: Promise<Record<string, string>>
getKeys
See Vault.getKeys
Returns: Promise<string[]>
getValue
See Vault.getValue
Parameters
Name | Type |
---|---|
key | string |
Returns: Promise<null | T>
importVault
Parameters
Name | Type |
---|---|
data | Record<string, string> |
Returns: Promise<void>
initialize
Usage
_10vault.initialize({_10 key: 'com.company.myvaultapp',_10 type: 'CustomPasscode',_10 deviceSecurityType: 'Both',_10 lockAfterBackgrounded: 2000,_10});
Parameters
Name | Type |
---|---|
config | IdentityVaultConfig |
Returns: Promise<void>
isEmpty
See Vault.isEmpty
Returns: Promise<boolean>
isLocked
See Vault.isLocked
Returns: Promise<boolean>
lock
See Vault.lock
Returns: Promise<void>
onConfigChanged
Parameters
Name | Type |
---|---|
callback | Callback<IdentityVaultConfig> |
Returns: void
onError
See Vault.onError
Parameters
Name | Type |
---|---|
callback | Callback<VaultError> |
Returns: void
onLock
See Vault.onLock
Parameters
Name | Type |
---|---|
callback | Callback<VaultLockEvent> |
Returns: void
onPasscodeRequested
Parameters
Name | Type |
---|---|
callback | (isPasscodeSetRequest : boolean, onComplete : (code : string) => void) => void |
Returns: void
Parameters
Name | Type |
---|---|
callback | (isPasscodeSetRequest : boolean) => Promise<void> |
Returns: void
onUnlock
See Vault.onUnlock
Parameters
Name | Type |
---|---|
callback | EmptyCallback |
Returns: void
removeValue
Parameters
Name | Type |
---|---|
key | string |
Returns: Promise<void>
setCustomPasscode
Parameters
Name | Type |
---|---|
passcode | string |
Returns: Promise<void>
setValue
See Vault.setValue
Parameters
Name | Type |
---|---|
key | string |
value | T |
Returns: Promise<void>
unlock
See Vault.unlock
Returns: Promise<void>
updateConfig
Parameters
Name | Type |
---|---|
config | IdentityVaultConfig |
Returns: Promise<void>