Protection Policy

View this page for | |

The protection policy defines the protection requirements for a provisioned object (Transaction Signing Key, Session Transport Key, or OTP Key).

The HIDPolicyType values are:

  • Device – the object is protected against cloning (that is, it cannot be used outside the mobile device).
  • Password – the object is also protected by an end-user password.
  • BioPassword – same as Password but with additional support for an alternative biometric authentication (for example, TouchID/FaceID) on a hardware-capable device.

For further details, see:

ActivID AS push solution customization

ActivID Appliance push solution customization

HID Authentication Service push solution customization

PasswordPolicy

This policy defines the constraints on the password protecting the object:

  • Minlength – Minimum password length
  • Maxlength – Maximum password length
  • Additional restrictions for alphanumeric format:
    • Min Number of UpperCase letters
    • Min Number of LowerCase letters
    • Min Number of Alpha characters
    • Min Number of Numeric characters
    • Min Number of Non-Alphanumeric characters
    • Maximum Number of UpperCase letters
    • Maximum Number of LowerCase letters
    • Maximum Number of Alpha characters
    • Maximum Number of Numeric characters
    • Maximum Number of Non-Alphanumeric characters
  • History restriction parameters:
    • maxHistory – number of unique new passwords that have to be associated with the key before an old password can be reused. 0 authorizes users to reuse current password when password is changed. This value is set by the server.

    • minAge – period of time (in days) that a password must be used before the user can change it. It must be less than the maximum password age. 0 allow changes immediately. This value is set by the server.

    • Note: When >0, the initial password must be changed at the end of the provisioning for the minAge parameter to be taken into account.
    • maxAge – period of time (in days) users can keep a password before they have to change it. 0 means password never expires. This value is set by the server.

      Note: Password expiration (maxAge) is ignored when the SilentLockPolicy is configured for use.
Note:  
  • When defining the rules of the password policy, make sure that there are no logical conflicts. For example, do not specify that the minimum number of numeric characters is 8, in combination a maximum password length of 6 characters.

  • When not set, the maximum values are equal to the maximum length defined for the password.

BioPasswordPolicy – Authentication with Biometrics (TouchID or FaceID)

Biometric authentication is a convenient alternative to password authentication for end users.

Importantly, it does not replace the password as users can fallback to password authentication at any time.

In that perspective, provisioning for biometric authentication is the same as Container Provisioning. The user must provide the password during the container creation.

  • Server-side – the policy to configure at container or key level is ‘biometricorpassword’.
  • Client-side – the policy protecting the keys is represented by BioPasswordPolicy, extending PasswordPolicy.
Note: If the user’s device does not have a fingerprint sensor (or the manufacturer does not support Biometrics), then the policy is represented by PasswordPolicy.

For further details, see:

ActivID AS Key Protection Policy Parameters

ActivID Appliance Key Protection Policy Parameters

HID Authentication Service Key Protection Policy Parameters

Enabling Authentication with Fingerprint or Face

By default, biometric authentication is not enabled. That means that BioPasswordPolicy acts exactly as PasswordPolicy until it is explicitly enabled.

The authentication state can be discovered using BioPasswordPolicy.getBioAuthenticationState. It returns one of the BioAuthenticationState enumeration values:

To enable biometric authentication, the app calls BioPasswordPolicy.enableBioAuthentication as illustrated below.

Sample Enabling Biometric Authentication on iOS

Copy
id<HIDProtectionPolicy> containerPolicy = [pContainer getProtectionPolicy:&error];if ([containerPolicy policyType] == HIDPolicyTypeBioPassword)
{
    id<HIDBioPasswordPolicy> bioPasswordPolicy = (id<HIDBioPasswordPolicy>)containerPolicy;
    if ([bioPasswordPolicy getBioAuthenticationState] == HIDBioAuthenticationStateNotEnabled)
    {
        // Prompt user for his/her password
        // Then enable authentication with fingerprint
         [bioPasswordPolicy enableBioAuthentication:password error:&error];
    }
}

Authenticating with Fingerprint or Face

Regardless of the operation to perform (transaction signing, OTP generation…), if the key is protected by BioPasswordPolicy (Key.getProtectionPolicy) and fingerprint or facial authentication is enabled (BioPasswordPolicy.getBioAuthenticationState), then the app does not have to prompt the end user for their password. Instead, the app calls the SDK methods, passing null value as the password.

The behavior depends on the platform.

The HID Approve SDK leverages the iOS keychain capabilities to protect items with ACL.

When performing the requested operation, the SDK accesses an item protected with TouchID or FaceID – the operating system displays a modal dialog box on top of the app. The app does not have control over this dialog box.

The HID Approve SDK method is called with password argument set to null. The method is blocked until the user has provided their fingerprint or face.

  • If fingerprint/face is successfully matched, the method proceeds.
  • If fingerprint/face does not match, the method returns error HIDPasswordRequired.

For further details, see:

ActivID AS Key Protection Policy Parameters

ActivID Appliance Key Protection Policy Parameters

HID Authentication Service Key Protection Policy Parameters

Note: Fingerprint authentication becomes impossible when fingerprints are added or removed at the system level. The app must enable it again.

Sample Fingerprint Authentication on iOS (Objective-C)

Copy
// Get HIDKey instance as demonstrated for OTP generation 
// Get protection policy protecting the key
NSString* password = nil;
id<HIDProtectionPolicy> protectionPolicy = [pKey getProtectionPolicy:&error];
if ([protectionPolicy policyType] == HIDPolicyTypeBioPassword)
{
    id<HIDBioPasswordPolicy> bioPasswordPolicy = (id<HIDBioPasswordPolicy>)protectionPolicy;
    if ([bioPasswordPolicy getBioAuthenticationState] != HIDBioAuthenticationStateEnabled)
    {
        // Prompt user for his/her password
        password = …
    }
}
 
// Get default OTP generator for this key.
id<HIDOTPGenerator> pOTPGenerator = [pKey getDefaultOTPGenerator:&error];
 
// Get the next OTP.
// We assume the generator is Synchronous (HOTP or TOTP algorithms)
NSString* otp = [((id<HIDSyncOTPGenerator>)pOTPGenerator) getOTP:password error:&error];

Lock Policy

The following sections define the HIDLockType type and parameters for the password and lock.

Type

  • noLock – password never locks.
  • counterLock – password locks after maximum counter value is reached.
  • delayLock – an exponential delay is inserted between each failed authentication attempt.
  • silentLockHIDLockTypeSilent – any password is accepted without providing indication of an incorrect password when offline (delegating control, auditing, and verification of cryptographic operations to the server-side).

Parameters

For further details, see:

ActivID AS Key Protection Policy Parameters

ActivID Appliance Key Protection Policy Parameters

HID Authentication Service Key Protection Policy Parameters