public class CipherClient extends Object
encrypt(String)/decrypt(String) by calling isKeystoreUnlocked() then
unlockKeystore(), note that the latter will open the system Activity to set a password/PIN/Pattern required
to unlock the screen & the KeyStore.| Constructor and Description |
|---|
CipherClient(android.content.Context context) |
| Modifier and Type | Method and Description |
|---|---|
String |
decrypt(String user_encrypted)
Takes a previously
encrypt(String) to decrypted it
using the Android Key Store. |
String |
encrypt(String user)
|
boolean |
isKeystoreUnlocked()
Checks whether the Android KeyStore is available.
|
void |
unlockKeystore()
Helps unlock the KeyStore this will launch the appropriate
Intent
to start the platform system Activity to create/unlock the KeyStore. |
public CipherClient(android.content.Context context)
throws KeyStoreException
KeyStoreExceptionpublic String encrypt(String user) throws KeyStoreException
String and return the encrypted version
of this String using the Android Key Store.user - represents the Token of a SyncUser.KeyStoreException - in case the Key Store is locked or other error.public String decrypt(String user_encrypted) throws KeyStoreException
encrypt(String) to decrypted it
using the Android Key Store.user_encrypted - represents the encrypted Token of a SyncUser.KeyStoreException - in case the KeyStore is locked or other error.public boolean isKeystoreUnlocked()
throws KeyStoreException
encrypt(String) or decrypt(String) as those need the KeyStore unlocked.true if the Android KeyStore in unlocked.KeyStoreException - in case of error.public void unlockKeystore()
throws KeyStoreException
Intent
to start the platform system Activity to create/unlock the KeyStore.KeyStoreException - in case of error.