public interface ArmadilloSharedPreferences
extends android.content.SharedPreferences
SharedPreferences interface this exports additional APIs specific
to armadillo.| Modifier and Type | Method and Description |
|---|---|
void |
changePassword(char[] newPassword)
Changes the user provided password to the new given password.
|
void |
changePassword(char[] newPassword,
KeyStretchingFunction function)
Changes the user provided password to the new given password and sets a new stretching function.
|
void |
close()
Clears most of the internal state and makes the instance unusable.
|
boolean |
isValidPassword()
Determines whether the user-provided password used to initialises Armadillo is the right one or not.
|
boolean isValidPassword()
Armadillo.Builder.supportVerifyPassword(boolean) has to be enabled to be able to use
this method.
In order to verify the password, a known value is stored encrypted with the password the first time that Armadillo is initialised. When this method is called, it tries to decrypt this value and compares it to the original value. If the values match the validation succeeds, otherwise, it fails.
Warning: Depending on the use key stretching function this is a very expensive call, do it in a background thread.
java.lang.UnsupportedOperationException - when support verify password is not enabledvoid changePassword(char[] newPassword,
KeyStretchingFunction function)
This method can be used to switch from a generated key to a key derived from user-provided password.
A null or zero length password will reset the password (as if no user-provided password is set).
Warning: Depending on the use key stretching function and count of saved data this is a very expensive call, do it in a background thread.
newPassword - which will be additionally used to create the key for the encryptionfunction - set a new function to be used the encrypt with new password. It will be
ignored if null is passed.void changePassword(char[] newPassword)
This method can be used to switch from a generated key to a key derived from user-provided password.
A null or zero length password will reset the password (as if no user-provided password is set).
Warning: Depending on the use key stretching function and count of saved data this is a very expensive call, do it in a background thread.
newPassword - which will be additionally used to create the key for the encryptionvoid close()