public abstract class PinProtectedProvider extends java.lang.Object implements EncryptionProvider
| Constructor and Description |
|---|
PinProtectedProvider()
Default constructor
|
| 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
|
protected abstract Encrypter |
createEncrypter(com.tozny.crypto.android.AesCbcWithIntegrity.SecretKeys masterKey) |
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.
|
boolean |
passphraseExists(android.content.Context context) |
void |
startWithPassphrase(android.content.Context context,
java.lang.String passphrase)
This method should attempt to initialize the Encrypter with the provided pin, otherwise it
should throw a
StorageAccessException |
public Encrypter getEncrypter()
EncryptionProviderEncryptionProvider.startWithPassphrase(android.content.Context, java.lang.String).getEncrypter in interface EncryptionProviderpublic void logAccessTime()
EncryptionProviderlogAccessTime in interface EncryptionProviderpublic boolean hasPinCode(android.content.Context context)
EncryptionProviderhasPinCode in interface EncryptionProvidercontext - android contextpublic void createPinCode(android.content.Context context,
java.lang.String pin)
EncryptionProvidercreatePinCode in interface EncryptionProvidercontext - android contextpin - the pin that the user enteredpublic void changePinCode(android.content.Context context,
java.lang.String oldPin,
java.lang.String newPin)
EncryptionProviderchangePinCode in interface EncryptionProvidercontext - android contextoldPin - user input for old pinnewPin - user input for the new pinprotected abstract Encrypter createEncrypter(com.tozny.crypto.android.AesCbcWithIntegrity.SecretKeys masterKey)
public void startWithPassphrase(android.content.Context context,
java.lang.String passphrase)
EncryptionProviderStorageAccessExceptionstartWithPassphrase in interface EncryptionProvidercontext - android contextpassphrase - the pin input from the userpublic boolean passphraseExists(android.content.Context context)
public boolean needsAuth(android.content.Context context,
PinCodeConfig codeConfig)
EncryptionProviderneedsAuth in interface EncryptionProvidercontext - android contextcodeConfig - the pin config for the app