Skip to content

Passcode Policy Store

PasscodePolicyStoreStep opens a special secure store on the device for storing information related to the unlock process of the application store (passcode policy information).

For the onboard scenario, a new secure store is created. For the restore scenario, an existing secure store is reopened. For the reset scenario, the existing secure store is erased and a new one created.

Please note that Flows does not store the whole passcode policy in this passcode policy store. It stores only a limited set of data in this store, which is mandatory prerequisite for the unlock process of the application store.

This secure store is protected by a generated passcode and the data is encrypted.

This should be the first step of the onboard and restore scenarios, and the last step of the reset one.

Input Parameters

Mandatory input parameters: * context – Specifies the android context initiating the flow such as the caller Activity. This setting has to be provided on the initial FlowContext.

Optional input parameters: * flowPresentationActionHandler – Specifies the Action Handler for Flow Presentation. If the user does not want to specify it's functionality, the default implementation can be used instead. (This is set on the flowContext by the app developer at the start of the flow). This step has no UI. It uses the flowPresentationActionHandler only for displaying error messages.

Output Parameters

  • secure store for passcode policy – Properly initialized and opened secure store implementation. The new passcode policy store can be accessed using the getPasscodePolicyStore method of the OnboardingContext.

Using StoreManagerStep

  1. Set the policy data in the flowContext.

    1
      flowContext.setContext(activity);
    
  2. Initiate the step:

    1
      PasscodePolicyStoreStep passcodePolicyStoreStep = new PasscodePolicyStoreStep();
    
  3. Specify the execute method's FlowActionHandler parameter's "onFailure" and "onSuccess" behaviour:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
        flowManagerService.execute(flow, flowContext, new FlowActionHandler() {
            @Override
            public void onFailure(Throwable t) {
                //set the status, update the caller activity
            }
    
            @Override
            public void onSuccess(FlowContext result) {
                //set the status, update the caller activity
                //read the result
            }
        });
    

Behaviour of PasscodePolicyStoreStep

For the onboard scenario, a new secure store instance is created with a generated passcode.

For the restore scenario, the generated passcode is used to reopen the store.

For the reset scenario, this step erases the secure store and recreates an empty one.

Relationship to Other Steps

StoreManagerStep uses the output of this step in order to store the number of the remaining attempts allowed for the end user to reopen the application store.