Performs the passkey assertion for a vault and decrypts its secret.
@param ― options - Relying party ID and vault.
@returns ― The decrypted secret bytes in a fresh allocation.
@remarks ― Runs one assertion ceremony and shows one user-verification prompt. The
assertion is restricted to the credential stored in the vault.
@throws ― MeraError with code VAULT_FORMAT_INVALID when the vault's required structure, version, or encoded data is invalid.
@throws ― MeraError with code PRF_UNAVAILABLE when the authenticator does not return a usable 32-byte PRF output.
@throws ― MeraError with code DECRYPT_FAILED when AES-GCM authentication fails.
@throws ― MeraError with code CRYPTO_UNAVAILABLE when crypto.getRandomValues or crypto.subtle is unavailable, or crypto.subtle lacks the HKDF or AES-GCM support the vault needs.
@throws ― MeraError with code PASSKEY_CANCELLED when the person dismisses the prompt, it times out, or no passkey answers.
@throws ― MeraError with code PASSKEY_OPERATION_FAILED when WebAuthn is unavailable, fails for another reason, or returns an unexpected credential.
Performs the passkey assertion for a vault and decrypts its secret.
@param ― options - Relying party ID and vault.
@returns ― The decrypted secret bytes in a fresh allocation.
@remarks ― Runs one assertion ceremony and shows one user-verification prompt. The
assertion is restricted to the credential stored in the vault.
@throws ― MeraError with code VAULT_FORMAT_INVALID when the vault's required structure, version, or encoded data is invalid.
@throws ― MeraError with code PRF_UNAVAILABLE when the authenticator does not return a usable 32-byte PRF output.
@throws ― MeraError with code DECRYPT_FAILED when AES-GCM authentication fails.
@throws ― MeraError with code CRYPTO_UNAVAILABLE when crypto.getRandomValues or crypto.subtle is unavailable, or crypto.subtle lacks the HKDF or AES-GCM support the vault needs.
@throws ― MeraError with code PASSKEY_CANCELLED when the person dismisses the prompt, it times out, or no passkey answers.
@throws ― MeraError with code PASSKEY_OPERATION_FAILED when WebAuthn is unavailable, fails for another reason, or returns an unexpected credential.
Parses and validates untrusted secret-vault JSON or objects.
Only version 1 vaults are accepted. The credential ID, PRF salt, nonce, and
ciphertext are validated as canonical base64url and length-checked. Unknown
fields are dropped from the returned vault.
@param ― value - Secret vault as JSON text or an untrusted object.
@returns ― A validated secret vault.
@throws ― MeraError with code VAULT_FORMAT_INVALID when required structure, version, or encoded data is invalid.
Parses and validates untrusted secret-vault JSON or objects.
Only version 1 vaults are accepted. The credential ID, PRF salt, nonce, and
ciphertext are validated as canonical base64url and length-checked. Unknown
fields are dropped from the returned vault.
@param ― value - Secret vault as JSON text or an untrusted object.
@returns ― A validated secret vault.
@throws ― MeraError with code VAULT_FORMAT_INVALID when required structure, version, or encoded data is invalid.
The getItem() method of the Storage interface, when passed a key name, will return that key's value, or null if the key does not exist, in the given Storage object.
Performs the passkey assertion for a vault and decrypts its secret.
@param ― options - Relying party ID and vault.
@returns ― The decrypted secret bytes in a fresh allocation.
@remarks ― Runs one assertion ceremony and shows one user-verification prompt. The
assertion is restricted to the credential stored in the vault.
@throws ― MeraError with code VAULT_FORMAT_INVALID when the vault's required structure, version, or encoded data is invalid.
@throws ― MeraError with code PRF_UNAVAILABLE when the authenticator does not return a usable 32-byte PRF output.
@throws ― MeraError with code DECRYPT_FAILED when AES-GCM authentication fails.
@throws ― MeraError with code CRYPTO_UNAVAILABLE when crypto.getRandomValues or crypto.subtle is unavailable, or crypto.subtle lacks the HKDF or AES-GCM support the vault needs.
@throws ― MeraError with code PASSKEY_CANCELLED when the person dismisses the prompt, it times out, or no passkey answers.
@throws ― MeraError with code PASSKEY_OPERATION_FAILED when WebAuthn is unavailable, fails for another reason, or returns an unexpected credential.
A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the
requested number of bytes could not be allocated an exception is raised.
Uint8Array<
interface ArrayBuffer
Represents a raw buffer of binary data, which is used to store data for the
different typed arrays. ArrayBuffers cannot be read from or written to directly,
but can be passed to a typed array or DataView Object to interpret the raw
buffer as needed.
CRYPTO_UNAVAILABLE: the runtime provides no crypto.getRandomValues or crypto.subtle, or its crypto.subtle lacks the HKDF or AES-GCM support the vault needs.