Enum UnlockPolicy
- All Implemented Interfaces:
Comparable<UnlockPolicy>
How a vault may be reopened, chosen by the application and explained to the user.
This is the trade an application actually has to make, so it is a choice of three named behaviours rather than a set of cryptographic parameters. What changes between them is which wraps of the data key are allowed to exist on this device -- and the rule that makes the strongest one mean anything is that choosing it removes the weaker wraps rather than leaving them beside it. A vault that requires a passkey and also keeps an unattended device wrap is a vault that does not require a passkey.
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe user chose to be remembered on this device.The device key exists but reaching it requires the user to verify themselves -- a biometric, a device passcode, a passkey with user verification.The password is required every time the application starts, or in a browser every time the page loads. -
Method Summary
Modifier and TypeMethodDescriptionstatic UnlockPolicyReturns the enum constant of this type with the specified name.static UnlockPolicy[]values()Returns an array containing the constants of this enum type, in the order they are declared.Methods inherited from class Enum
clone, compareTo, equals, getDeclaringClass, getEnumValues, hashCode, name, ordinal, setEnumValues, toString, valueOf
-
Enum Constant Details
-
SESSION_ONLY
The password is required every time the application starts, or in a browser every time the page loads.
Nothing that can reopen the vault is written to the device: the data key exists only in memory between unlock and lock. The strongest of the three against a stolen device or a copied browser profile, and the one users abandon, which is why it is not the default for anything.
-
REMEMBER_DEVICE
The user chose to be remembered on this device.
The data key is additionally wrapped under a device key -- the OS key store on a native port, a non-extractable
CryptoKeyin the browser -- so the vault reopens without a prompt. That is unattended access by design: anyone who can run the application on this device, or who copies a full browser profile including its IndexedDB, reopens the vault without knowing the password.An application offering this must say so in those words. "Remember me" reads as a convenience and is a change in who can read the data.
-
REQUIRE_USER_VERIFICATION
The device key exists but reaching it requires the user to verify themselves -- a biometric, a device passcode, a passkey with user verification.
Choosing this deletes any
REMEMBER_DEVICEwrap that already existed, and refuses to create one while it is in force. Without that, the unattended wrap sits beside the gated one and the prompt is decoration.Not every platform can provide it.
Vault.capabilities()reports whether this device can, andVault.enroll(char[], VaultOptions)fails withVaultError.POLICY_NOT_METrather than quietly enrolling under a weaker policy.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-