API Reference

Complete documentation for the IVault interface.

init()

async

Initialize WASM and prepare crypto environment.

init(config?: VaultConfig): Promise<void>

register()

async

Create new identity. Returns DID and recovery code.

register(password: string): Promise<RegistrationResult>

login()

async

Unlock existing identity.

login(password: string, did?: string): Promise<IdentityInfo>

saveSecret()

async

Encrypt and store key-value pair.

saveSecret(key: string, value: string): Promise<void>

getSecret()

async

Retrieve and decrypt secret. Returns null if not found.

getSecret(key: string): Promise<string | null>

lock()

sync

Clear sensitive data from memory. Logs out user.

lock(): void