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.
The TextEncoder.encode() method takes a string as input, and returns a Global_Objects/Uint8Array containing the text given in parameters encoded with the specific method for that TextEncoder object.
The setItem() method of the Storage interface, when passed a key name and value, will add that key to the given Storage object, or update that key's value if it already exists.
Optional; when omitted, WebAuthn may choose any discoverable credential for the relying party
Credential metadata that restricts the assertion to one passkey. Reported transports are retained in the new vault when the selected credential matches.
Versioned JSON-safe vault holding one secret encrypted behind a passkey.
The secret bytes are opaque to the library.
PasskeySecretVault } from"@category-labs/mera";
type
type ReturnType =Promise<PasskeySecretVault>
ReturnType=
interface Promise<T>
Represents the completion of an asynchronous operation
Promise<
type PasskeySecretVault = {
readonly version:1;
readonly credential:PasskeyCredentialMetadata;
readonly prfSalt:string;
readonly nonce:string;
readonly ciphertext:string;
}
Versioned JSON-safe vault holding one secret encrypted behind a passkey.
The secret bytes are opaque to the library.
PasskeySecretVault>;
A JSON-safe vault with version, credential, prfSalt, nonce, and ciphertext. It contains the selected credential’s metadata and a fresh random 32-byte PRF salt. The secret vault format page documents every field.