MasterKeyKt

Added in 1.1.0-alpha07

public final class MasterKeyKt


Summary

Public methods

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

Creates a MasterKey with the provided parameters.

Public methods

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

Creates a MasterKey with the provided parameters.

Parameters
@NonNull Context context

The context to work with.

@NonNull String keyAlias

The alias to use for the MasterKey.

@NonNull 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.