MasterKeyKt

public final class MasterKeyKt


Summary

Public methods

static final @NonNull MasterKey
MasterKey(
    Context context,
    String keyAlias,
    MasterKey.KeyScheme keyScheme,
    boolean authenticationRequired,
    int userAuthenticationValidityDurationSeconds,
    boolean requestStrongBoxBacked
)

Creates a MasterKey with the provided parameters.

Public methods

MasterKey

public static final @NonNull MasterKey MasterKey(
    Context context,
    String keyAlias,
    MasterKey.KeyScheme keyScheme,
    boolean authenticationRequired,
    int userAuthenticationValidityDurationSeconds,
    boolean requestStrongBoxBacked
)

Creates a MasterKey with the provided parameters.

Parameters
Context context

The context to work with.

String keyAlias

The alias to use for the MasterKey.

MasterKey.KeyScheme keyScheme

The MasterKey.KeyScheme to have the MasterKey use.

boolean authenticationRequired

true if the user must authenticate for the MasterKey to be used.

int userAuthenticationValidityDurationSeconds

Duration in seconds that the MasterKey is valid for after the user has authenticated. Must be a value 0.

boolean requestStrongBoxBacked

true if the key should be stored in Strong Box, if possible.