public class UnencryptedProvider extends java.lang.Object implements EncryptionProvider
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PIN_CODE_ERROR_MSG |
Constructor and Description |
---|
UnencryptedProvider() |
Modifier and Type | Method and Description |
---|---|
void |
changePinCode(android.content.Context context,
java.lang.String oldPin,
java.lang.String newPin)
Changes the pin code if the old pin provided matches
|
void |
createPinCode(android.content.Context context,
java.lang.String pin)
Create a pin code from the provided input
|
Encrypter |
getEncrypter()
Returns the Encrypter for data being written to disk, which should be initialized in
EncryptionProvider.startWithPassphrase(android.content.Context, java.lang.String) . |
boolean |
hasPinCode(android.content.Context context)
Returns whether the user has created a pin code.
|
void |
logAccessTime()
Logs the time of access for deciding whether to re-prompt the user for a pin after having
been away from the app for longer than the lock time.
|
boolean |
needsAuth(android.content.Context context,
PinCodeConfig codeConfig)
Returns a boolean indicating whether authentication is needed.
|
void |
startWithPassphrase(android.content.Context context,
java.lang.String pin)
This method should attempt to initialize the Encrypter with the provided pin, otherwise it
should throw a
StorageAccessException |
public static final java.lang.String PIN_CODE_ERROR_MSG
public boolean hasPinCode(android.content.Context context)
EncryptionProvider
hasPinCode
in interface EncryptionProvider
context
- android contextpublic void createPinCode(android.content.Context context, java.lang.String pin)
EncryptionProvider
createPinCode
in interface EncryptionProvider
context
- android contextpin
- the pin that the user enteredpublic void changePinCode(android.content.Context context, java.lang.String oldPin, java.lang.String newPin)
EncryptionProvider
changePinCode
in interface EncryptionProvider
context
- android contextoldPin
- user input for old pinnewPin
- user input for the new pinpublic boolean needsAuth(android.content.Context context, PinCodeConfig codeConfig)
EncryptionProvider
needsAuth
in interface EncryptionProvider
context
- android contextcodeConfig
- the pin config for the apppublic void startWithPassphrase(android.content.Context context, java.lang.String pin)
EncryptionProvider
StorageAccessException
startWithPassphrase
in interface EncryptionProvider
context
- android contextpin
- the pin input from the userpublic void logAccessTime()
EncryptionProvider
logAccessTime
in interface EncryptionProvider
public Encrypter getEncrypter()
EncryptionProvider
EncryptionProvider.startWithPassphrase(android.content.Context, java.lang.String)
.getEncrypter
in interface EncryptionProvider