Reputation: 3931
We are using worklight 6.1 and want to use encrypted cache on client side but before implementing it we just want to confirm whether this require any server call or not.
When we do any call to this api whether worklight server connection is required or not? At the time of calling this api whether worklight server is storing anything related to it?
We don't want server call so please suggest whether this is correct choice for storing sensitive data on client side?
Upvotes: 1
Views: 76
Reputation: 44516
When using WL.EncryptedCache
, a call is made to the Worklight Server in order to generate a random number, so at the very least Internet connectivity is required.
If you don't want this, you should opt to using the JSONStore feature instead, which is more powerful and feature-rich.
Note the following if you opt to use JSONStore:
When the localKeyGen key is present in the JavaScript implementation of the JSONStore API, and it has a value of true, a cryptographically secure token is generated locally. Otherwise, the token is generated by contacting the server, thus requiring connectivity to the Worklight® Server. This token is required only the first time that a store is opened with a password.
An example of how you would pass the flag:
WL.JSONStore.init(..., {localKeyGen: true})
.then(...)
.fail(...);
Upvotes: 1