public interface PasswordManager
Modifier and Type | Method and Description |
---|---|
void |
changePassword(SecureString oldPassword,
SecureString newPassword)
Changes the password after the password was set.
|
boolean |
isLoggedIn()
Checks if the password manager is logged in.
|
boolean |
isMigrationFromSDK2xNeeded()
Determines whether or not the SDK needs a migration from version 2.x to
current version.
|
boolean |
isPasswordSet()
Checks if the password is set.
|
void |
login()
Unlocks all password domain(s) without the need to use a password.
|
void |
login(SecureString password)
Unlocks all password domain(s).
|
void |
logout()
Logs out of the password manager.
|
void |
migrateTokenPasswordFromSDK2x(SecureString oldTokenPassword,
SecureString password)
Migrate the SDK from a 2.x version to current version.
|
void |
removePassword(SecureString oldPassword)
Removes the password.
|
boolean |
reset()
The reset of the password manager, will delete all files related to password manager.
|
void |
setPassword(SecureString password)
Sets the password.
|
boolean isPasswordSet() throws PasswordManagerException
PasswordManagerException
- exception that contains the information of the error.void setPassword(SecureString password) throws PasswordManagerException
changePassword(SecureString, SecureString)
should be used
instead).
Actionable reasons for failure:
password
- The global password value to set. Cannot be null
.PasswordManagerException
- exception that contains the information of the error.void changePassword(SecureString oldPassword, SecureString newPassword) throws PasswordManagerException
setPassword(SecureString)
instead.
oldPassword
- The previously set password. Cannot be null
.newPassword
- The new password to be applied. Cannot be null
.PasswordManagerException
- exception that contains the information of the error.void removePassword(SecureString oldPassword) throws PasswordManagerException
login()
method.
This is considered unsafe.
oldPassword
- The previously set password. Cannot be null
.PasswordManagerException
- exception that contains the information of the error.boolean isLoggedIn() throws PasswordManagerException
PasswordManagerException
- exception that contains the information of the error.void login() throws PasswordManagerException
PasswordManagerException
- exception that contains the information of the error.void login(SecureString password) throws PasswordManagerException
password
- The previously set password. Cannot be null
.PasswordManagerException
- exception that contains the information of the error.void logout() throws PasswordManagerException
PasswordManagerException
- exception that contains the information of the error.void migrateTokenPasswordFromSDK2x(SecureString oldTokenPassword, SecureString password) throws PasswordManagerException
Migrate the SDK from a 2.x version to current version. If the application is being updated from a previous version, this method may need to be called to enable the password manager to manage passwords for the TOKEN functionalities.
Until this method is call, an SDK that requires a migration will be
unable to generate or verify any kind of OTP. The method
isMigrationFromSDK2xNeeded()
can be called to determine
if the migration is needed.
The method only needs to be called once, preferable on first startup after update of an application.
oldTokenPassword
- The password used in the previous version of the application
to secure the Token. Use null
if no password was set
in the previous version.password
- The password used for login in the PasswordManager. Use
null
if you are not using any password.PasswordManagerException
- exception that contains the information of the error.boolean isMigrationFromSDK2xNeeded() throws PasswordManagerException
Determines whether or not the SDK needs a migration from version 2.x to
current version. If the migration is needed, method
migrateTokenPasswordFromSDK2x(com.gemalto.idp.mobile.core.util.SecureString, com.gemalto.idp.mobile.core.util.SecureString)
should be called.
PasswordManagerException
- exception that contains the information of the error.boolean reset() throws PasswordManagerException
PasswordManagerException
- exception that contains the information of the error.IdpCore.reset()