Encode/decode for Vault.