Package 

Class MasterKey.Builder

    • Constructor Detail

      • MasterKey.Builder

        MasterKey.Builder(Context context)
        Creates a builder for a MasterKey using the default alias of .
        Parameters:
        context - The context to use with this master key.
      • MasterKey.Builder

        MasterKey.Builder(Context context, String keyAlias)
        Creates a builder for a MasterKey.
        Parameters:
        context - The context to use with this master key.
    • Method Detail

      • setUserAuthenticationRequired

        @NonNull() MasterKey.Builder setUserAuthenticationRequired(boolean authenticationRequired)

        When used with setKeyScheme, sets that the built master key shouldrequire the user to authenticate before it's unlocked, probably using theandroidx.biometric library.

        This method sets the validity duration of the key to .

        Parameters:
        authenticationRequired - Whether user authentication should be required to use thekey.
      • setUserAuthenticationRequired

        @NonNull() MasterKey.Builder setUserAuthenticationRequired(boolean authenticationRequired, @IntRange(from = 1) int userAuthenticationValidityDurationSeconds)

        When used with setKeyScheme, sets that the built master key shouldrequire the user to authenticate before it's unlocked, probably using theandroidx.biometric library, and that the key should remain unlocked for the providedduration.

        Parameters:
        authenticationRequired - Whether user authentication should be required to use thekey.
        userAuthenticationValidityDurationSeconds - Duration in seconds that the key shouldremain unlocked following user authentication.
      • setRequestStrongBoxBacked

        @NonNull() MasterKey.Builder setRequestStrongBoxBacked(boolean requestStrongBoxBacked)

        Sets whether or not to request this key is strong box backed. This setting is onlyapplicable on P and above, and only on devices that supportStrongbox.

        Parameters:
        requestStrongBoxBacked - Whether to request to use strongbox