public enum VaultError
- Object
- Enum<VaultError>
- VaultError
ImplementsComparable<VaultError>
Why a vault or protected-storage operation failed, as a code rather than a message.
Every distinction here exists because acting on the wrong one destroys data. The pair that
matters most is KEY_MISSING against TEMPORARILY_UNREADABLE: a caller that treats “I
could not read the key” as “there is no key” generates a replacement, and every record the
old key protected becomes unopenable. The same shape recurs for CORRUPT against
AUTHENTICATION_FAILED and for LOCKED against CANCELLED.
Enum constants
STORAGE_UNAVAILABLE | The platform has no store to write to, or the store could not be opened at all. |
CRYPTO_UNAVAILABLE | The cryptographic provider is missing or failed. |
POLICY_NOT_MET | The caller required protections this platform does not provide. |
INSECURE_CONTEXT | Hardened storage was requested from an insecure context – plain http: on anything but localhost. |
LOCKED | The vault exists but is locked. |
CANCELLED | The user dismissed a prompt, or the operation was aborted. |
KEY_MISSING | The store answered, and the key or entry is definitely not there. |
TEMPORARILY_UNREADABLE | The key or entry could not be read, and the store cannot say whether it exists. |
CORRUPT | The stored bytes are not a well formed envelope: truncated, a bad magic, a length field that does not fit. |
AUTHENTICATION_FAILED | The envelope parsed and the authentication tag did not verify. |
UNSUPPORTED_FORMAT | The envelope is well formed and declares a version, suite or KDF this build does not implement. |
QUOTA_EXCEEDED | The store refused the write for space, or evicted what was already there. |
CONFLICT | Two writers raced and this one lost, or the stored state moved under the operation. |
NOT_SUPPORTED | The requested mechanism is not implemented on this port – a passkey unlock where there is no authenticator, a hardware-backed key where there is no hardware. |
IMPORT_COMMITTED | Sync import reached committed state, but policy setup failed and rollback was unsafe or could not be confirmed. |
UNKNOWN | Anything the codes above do not cover. |
Methods
public static VaultError[] values() | |
public static VaultError valueOf(String name) |
Inherited methods
Enum constant details
STORAGE_UNAVAILABLE
STORAGE_UNAVAILABLECRYPTO_UNAVAILABLE
CRYPTO_UNAVAILABLEcrypto.subtle absent –
which is what an insecure context looks like from inside the page – or present and unable
to complete the operation.POLICY_NOT_MET
POLICY_NOT_METThe caller required protections this platform does not provide. The refused protection is
available from VaultException.getUnmetProtection().
Never downgraded silently: a request for encrypted storage on a platform that can only offer plaintext fails here rather than writing plaintext.
INSECURE_CONTEXT
INSECURE_CONTEXThttp: on anything but
localhost. Web Crypto is unavailable there by specification, and a vault that pretended
otherwise would be encrypting nothing.LOCKED
LOCKEDCANCELLED
CANCELLEDAUTHENTICATION_FAILED: nobody failed a check, the check did not happen.KEY_MISSING
KEY_MISSINGTEMPORARILY_UNREADABLE – justifies creating a replacement.TEMPORARILY_UNREADABLE
TEMPORARILY_UNREADABLECORRUPT
CORRUPTAUTHENTICATION_FAILED
AUTHENTICATION_FAILEDUNSUPPORTED_FORMAT
UNSUPPORTED_FORMATQUOTA_EXCEEDED
QUOTA_EXCEEDEDCONFLICT
CONFLICTNOT_SUPPORTED
NOT_SUPPORTEDIMPORT_COMMITTED
IMPORT_COMMITTEDUNKNOWN
UNKNOWNMethod details
values
public static VaultError[] values()valueOf
public static VaultError valueOf(String name)