This class wraps a native DAAuthProtocol object and exposes its methods.
More...
This class wraps a native DAAuthProtocol object and exposes its methods.
See the documentation for the native class for the precise semantics of the methods here.
Instances of this class own native DAAuthProtocol, (optionally) DADevice, DASession and DAAuthState objects: you must call dispose() when finished.
static native AuthProtocol com.good.daf.auth.AuthProtocol.authenticate |
( |
byte[] |
authToken, |
|
|
byte[] |
state |
|
) |
| |
|
static |
Commences the authentication protocol.
The DAF device used is the one returned by the native DADriver::getDevice function.
- Parameters
-
authToken | auth token given to device to create session |
state | the state data obtained by the last successful enrollment or change passphrase protocol |
- Returns
- a fresh instance of this class.
static native AuthProtocol com.good.daf.auth.AuthProtocol.authenticate |
( |
DADevice |
device, |
|
|
byte[] |
authToken, |
|
|
byte[] |
state |
|
) |
| |
|
static |
Commences the authentication protocol using the given device.
- Parameters
-
device | the device |
authToken | auth token given to device to create session |
state | the state data obtain by the last successful enrollment or change passphrase protocol |
- Returns
- a fresh instance of this class.
static native AuthProtocol com.good.daf.auth.AuthProtocol.changePassphrase |
( |
byte[] |
authToken, |
|
|
byte[] |
state |
|
) |
| |
|
static |
Commences the passphrase changing protocol.
The DAF device used is the one returned by the native DADriver::getDevice function.
- Parameters
-
authToken | auth token given to device to create session |
state | the state data obtained by the last successful enrollment or change passphrase protocol |
- Returns
- a fresh instance of this class.
static native AuthProtocol com.good.daf.auth.AuthProtocol.changePassphrase |
( |
DADevice |
device, |
|
|
byte[] |
authToken, |
|
|
byte[] |
state |
|
) |
| |
|
static |
Commences the passphrase change protocol using the given device.
- Parameters
-
device | the device |
authToken | auth token given to device to create session |
state | the state data obtain by the last successful enrollment or change passphrase protocol |
- Returns
- a fresh instance of this class.
native void com.good.daf.auth.AuthProtocol.dispose |
( |
| ) |
|
Destroys the native counterparts to this object.
This method must be called or a native memory leak will result. This method may be called more than once (subsequent calls have no effect).
static native AuthProtocol com.good.daf.auth.AuthProtocol.enroll |
( |
byte[] |
authToken | ) |
|
|
static |
Commences the enrollment protocol.
The DAF device used is the one returned by the native DADriver::getDevice function.
- Parameters
-
authToken | auth token given to device to create session |
- Returns
- a fresh instance of this class.
static native AuthProtocol com.good.daf.auth.AuthProtocol.enroll |
( |
DADevice |
device, |
|
|
byte[] |
authToken |
|
) |
| |
|
static |
Commences the enrollment protocol using the given device.
- Parameters
-
device | the device |
authToken | auth token given to device to create session |
- Returns
- a fresh instance of this class.
static native byte [] com.good.daf.auth.AuthProtocol.extractUserString |
( |
byte[] |
state | ) |
|
|
static |
Retrieves the current 'user string' given the a state string.
Returns null if there is no user string value.
native byte [] com.good.daf.auth.AuthProtocol.getNewSecret |
( |
| ) |
|
- Returns
- gets the new secret produced by a completed enrollment or change passphrase protocol.
native byte [] com.good.daf.auth.AuthProtocol.getSecret |
( |
| ) |
|
- Returns
- gets the secret produced by a completed authentication or change passphrase protocol.
native byte [] com.good.daf.auth.AuthProtocol.getState |
( |
| ) |
|
- Returns
- gets the new state produced by a completed enrollment or change passphrase protocol.
native byte [] com.good.daf.auth.AuthProtocol.getUserString |
( |
| ) |
|
Retrieves the current 'user string'.
Returns null if there is no user string value.
native void com.good.daf.auth.AuthProtocol.inputExistingPassphrase |
( |
byte[] |
pp | ) |
|
Inputs the existing passphrase into the protocol.
You only need call this if requiresExistingPassphrase returns true.
- Parameters
-
pp | the existing passphrase. must not be null. |
native void com.good.daf.auth.AuthProtocol.inputNewPassphrase |
( |
byte[] |
pp | ) |
|
Inputs the new/replacement passphrase into the protocol.
You only need call this if requiresNewPassphrase returns true.
- Parameters
-
pp | the new passphrase. must not be null. |
native boolean com.good.daf.auth.AuthProtocol.isFinished |
( |
| ) |
|
- Returns
- true if this protocol has completed
A completed protocol is one where you can obtain the new/existing
secrets and state through the getSecret/getNewSecret/getState
methods.
native boolean com.good.daf.auth.AuthProtocol.requiresExistingPassphrase |
( |
| ) |
|
- Returns
- true if this protocol requires the existing passphrase.
native boolean com.good.daf.auth.AuthProtocol.requiresNewPassphrase |
( |
| ) |
|
- Returns
- true if this protocol requires a new or replacement passphrase.
native void com.good.daf.auth.AuthProtocol.setUserString |
( |
byte[] |
us | ) |
|
Alters the 'user string' – an arbitrary string stored in the state which the caller may use for their own purposes.
No encoding or format is required.
This overwrites the current user string. You must persist the changes by calling getState() on this instance and persisting the result.
The documentation for this class was generated from the following file: