Digital Authentication Framework
6.0.1.37
|
This is the abstract base class for all Android DAF applications. More...
Public Member Functions | |
void | onCreate () |
Implementation of standard Android application method. More... | |
void | authenticateWithTrust (GDTrust gdt) |
Implementation of GDTrustListener interface method. More... | |
void | authenticateWithTrustWarn (final GDTrust trust, final String message, final Bitmap icon) |
Implementation of GDTrustListener interface method. More... | |
void | securityPolicyDidChange (GDTrust gdt) |
Implementation of GDAppEventListener interface method. More... | |
void | onGDEvent (GDAppEvent anEvent) |
Implementation of GDAppEventListener interface method. More... | |
boolean | deliverSecretAndStartupData (byte[] secret, byte[] startupData) |
Unlock the container and store startup data on success. More... | |
boolean | deliverSecret (byte[] secret) |
Unlocks the container given the correct secret passphrase replacement. More... | |
boolean | changeSecret (byte[] oldSecret, byte[] newSecret) |
Change the secret passphrase replacement. More... | |
boolean | changeSecretAndStartupData (byte[] oldSecret, byte[] newSecret, byte[] startupData) |
Change the secret passphrase replacement value, and saves the given startupData on success. More... | |
void | setIdleLock () |
Lock the container. More... | |
void | startTemporaryUnlock () |
Begin temporary-unlock sequence. More... | |
boolean | rejectAuthenticationRequest () |
(NEW IN 2.0) Cancel an authentication-with-warning request. More... | |
void | registerAppEventListener (GDAppEventListener l) |
Register for callbacks on GD app events. More... | |
void | unregisterAppEventListener (GDAppEventListener l) |
De-register callbacks on GD app events. More... | |
void | setCurrentActivity (Activity act) |
Mark activity as current. More... | |
void | unsetCurrentActivity (Activity act) |
Mark activity as no longer current. More... | |
boolean | isUnlocked () |
Informs the caller whether the GD container is currently unlocked. More... | |
AuthenticationWarning | getAuthenticationWarning () |
(NEW IN 2.0) Get warning information for current operation. More... | |
boolean | isAuthInProgress () |
Informs the caller whether the GD container is currently in the process of being unlocked. More... | |
void | processServiceRequest (final AuthenticationWarning w) |
Prepare to fulfil a GD ICC services request. More... | |
Bitmap | getAppIcon (final String appId) |
Fetches an icon for the given native application ID. More... | |
Static Public Member Functions | |
static DAFApplication | getInstance () |
Gets (singleton) instance of DAFApplication object. | |
static String | getStartupData () |
Returns the current startup data. More... | |
static AuthProcessParams | authenticate (DADevice device) |
Prepare to start the authentication protocol with the given device. More... | |
static EnrollProcessParams | enroll (DADevice device) |
Prepare to start the enrollment protocol with the given device. More... | |
static ChangePassphraseProcessParams | changePassphrase (DADevice device) |
Prepare to start the passphrase change protocol with the given device. More... | |
static ChangeDeviceProcessParams | changeDevice (DADevice oldDevice, DADevice newDevice) |
Prepare to start the device change protocol with the given device. More... | |
Protected Member Functions | |
void | loadNativeLibraries () |
Load required native library support. More... | |
abstract Class<?> | getProvisioningActivityClass () |
Implement this method to return the class of your provisioning activity. More... | |
abstract Class<?> | getAuthenticationActivityClass (final AuthenticationWarning w) |
Implement this method to return the class of your authentication activity. More... | |
This is the abstract base class for all Android DAF applications.
You should provide a concrete implementation of this class, by implementing getProvisioningActivityClass() and getAuthenticationActivityClass(). These methods instruct the rest of the class of which user interface activities should be invoked to (respectively) set-up and perform user authentication.
|
static |
Prepare to start the authentication protocol with the given device.
The object returned is a container for the inputs to the authentication protocol. You should input the other parameters (like an authToken, any pre-collected password, password collection callbacks, etc.) before calling that object's start method.
device | to use for authentication |
void com.good.daf.app.DAFApplication.authenticateWithTrust | ( | GDTrust | gdt | ) |
Implementation of GDTrustListener interface method.
Do not call this from DAF application code.
void com.good.daf.app.DAFApplication.authenticateWithTrustWarn | ( | final GDTrust | trust, |
final String | message, | ||
final Bitmap | icon | ||
) |
Implementation of GDTrustListener interface method.
Do not call this from DAF application code.
|
static |
Prepare to start the device change protocol with the given device.
Device change is implemented by authenticating with the old device, enrolling with the new device, and then issuing a change password request to GD and saving the new startup data.
oldDevice | old device, for authentication |
newDevice | new device, for enrollment |
|
static |
Prepare to start the passphrase change protocol with the given device.
The object returned is a container for the inputs to the passphrase change protocol. You should input the other parameters (like an authToken, any pre-collected passphrases, passphrase collection callbacks, etc.) before calling that object's start method.
device | to use for passphrase change process |
boolean com.good.daf.app.DAFApplication.changeSecret | ( | byte[] | oldSecret, |
byte[] | newSecret | ||
) |
Change the secret passphrase replacement.
This call can block for several seconds while doing crypto and IO. You should not call this from the main UI thread.
oldSecret | existing passphrase replacement |
newSecret | new passphrase replacement |
boolean com.good.daf.app.DAFApplication.changeSecretAndStartupData | ( | byte[] | oldSecret, |
byte[] | newSecret, | ||
byte[] | startupData | ||
) |
Change the secret passphrase replacement value, and saves the given startupData on success.
This call can block for several seconds while doing crypto and IO. You should not call this from the main UI thread.
oldSecret | existing passphrase replacement |
newSecret | new passphrase replacement |
startupData | new startup data, which is saved on success |
boolean com.good.daf.app.DAFApplication.deliverSecret | ( | byte[] | secret | ) |
Unlocks the container given the correct secret passphrase replacement.
This call can block for several seconds while doing crypto and IO. You should not call this from the main UI thread.
secret | passphrase replacement |
boolean com.good.daf.app.DAFApplication.deliverSecretAndStartupData | ( | byte[] | secret, |
byte[] | startupData | ||
) |
Unlock the container and store startup data on success.
Unlocks the container given the secret passphrase replacement and a new startup data string which replaces the old one on success (but is ignored on failure).
This call can block for several seconds while doing crypto and IO. You should not call this from the main UI thread.
secret | passphrase replacement |
startupData | new startup data string |
|
static |
Prepare to start the enrollment protocol with the given device.
The object returned is a container for the inputs to the enrollment protocol. You should input the other parameters (like an authToken, any pre-collected password, password collection callbacks, etc.) before calling that object's start method.
device | to use for enrollment process |
Bitmap com.good.daf.app.DAFApplication.getAppIcon | ( | final String | appId | ) |
Fetches an icon for the given native application ID.
This icon comes from the system's package manager, not the GD catalog.
This returns null on error.
|
abstractprotected |
Implement this method to return the class of your authentication activity.
w | (NEW IN 2.0) Description of warning to be presented to user, or null if no warning is required (regular application unlock). See Appendix - Authentication With Warning (Android) for discussion. |
AuthenticationWarning com.good.daf.app.DAFApplication.getAuthenticationWarning | ( | ) |
(NEW IN 2.0) Get warning information for current operation.
Informs the caller whether the application should present a warning to the user before authentication.
|
abstractprotected |
Implement this method to return the class of your provisioning activity.
|
static |
Returns the current startup data.
The startup data is an arbitrary string stored by the GD library in such a way that it is available before the container is unlocked, and follows the same life-cycle as other data needed to unlock the container.
boolean com.good.daf.app.DAFApplication.isAuthInProgress | ( | ) |
Informs the caller whether the GD container is currently in the process of being unlocked.
boolean com.good.daf.app.DAFApplication.isUnlocked | ( | ) |
Informs the caller whether the GD container is currently unlocked.
|
protected |
Load required native library support.
Override this method to call System.loadLibrary and any other setup functions shortly after the start of your application.
The default implementation of this method loads the library named 'dafprovider', i.e. libdafprovider.so.
This method should not throw.
void com.good.daf.app.DAFApplication.onCreate | ( | ) |
Implementation of standard Android application method.
Be sure to call this from your subclass before making any other DAF calls
void com.good.daf.app.DAFApplication.onGDEvent | ( | GDAppEvent | anEvent | ) |
Implementation of GDAppEventListener interface method.
Do not call this from DAF application code. If you wish to observe GD app events, use the registerAppEventListener() method.
void com.good.daf.app.DAFApplication.processServiceRequest | ( | final AuthenticationWarning | w | ) |
Prepare to fulfil a GD ICC services request.
On entry, DAFServices.Listener's queue has a request which needs to be fulfilled. This can be done synchronously, or this function will open your choice of Activity which should complete the request.
w describes the operation that will be dequeued next.
If you can service a request without any user interface for an operation described by w (say, AuthenticationWarning.REASON_GET_KEY_INFO) then your implementation of getAuthenticationActivityClass for that value of w can perform the following actions directly:
void com.good.daf.app.DAFApplication.registerAppEventListener | ( | GDAppEventListener | l | ) |
Register for callbacks on GD app events.
Adds the given object to the set of current recipients of GD app events.
If your activity needs to be informed of GDAppEvents, call this method from your activity's onResume handler.
Does nothing if the given object is already a recipient.
boolean com.good.daf.app.DAFApplication.rejectAuthenticationRequest | ( | ) |
(NEW IN 2.0) Cancel an authentication-with-warning request.
Informs the GD library that the user rejected an authentication request with a warning attached.
void com.good.daf.app.DAFApplication.securityPolicyDidChange | ( | GDTrust | gdt | ) |
Implementation of GDAppEventListener interface method.
Currently a no-op. This can be overridden in a subclass if you wish to observe policy updates.
void com.good.daf.app.DAFApplication.setCurrentActivity | ( | Activity | act | ) |
Mark activity as current.
Makes a note of the given activity as being the current one for this app.
DAFApplication needs an Activity so it has a context in the right task that it can use for launching other Activities in response to external stimuli.
You should call this from your main activity's onCreate handler.
void com.good.daf.app.DAFApplication.setIdleLock | ( | ) |
Lock the container.
Asks the GD library to lock the container as if the idle timeout had expired.
void com.good.daf.app.DAFApplication.startTemporaryUnlock | ( | ) |
Begin temporary-unlock sequence.
Asks the GD library to commence the temporary unlock procedure.
Once this completes, the ProvisioningActivity will be started to allow the authentication mechanism to be replaced.
void com.good.daf.app.DAFApplication.unregisterAppEventListener | ( | GDAppEventListener | l | ) |
De-register callbacks on GD app events.
Removes the given object from the current set of recipients of GD app events.
If your activity's onResume handler called registerAppEventListener, its onPause handler should call this method.
Does nothing if the object was not a recipient.
void com.good.daf.app.DAFApplication.unsetCurrentActivity | ( | Activity | act | ) |
Mark activity as no longer current.
Forgets the given activity as being the current one for this app, only if it is the current one. Does nothing if not.
You should call this from your main activity's onDestroy handler.