pub struct SearchProtocol<'a> { /* private fields */ }Implementations§
Source§impl<'a> SearchProtocol<'a>
impl<'a> SearchProtocol<'a>
pub fn new(keys: &'a MasterKeySet, state: &'a ClientStateTable) -> Self
Sourcepub fn prepare_search(
&self,
keyword: &str,
) -> Result<Option<SearchToken>, VaultError>
pub fn prepare_search( &self, keyword: &str, ) -> Result<Option<SearchToken>, VaultError>
Generate a single-use search token for keyword.
Returns Ok(None) if the keyword has no live results (never written or
all documents deleted), so the caller can skip the network round-trip.
Sourcepub async fn fetch_token_results<S: EncryptedStore>(
&self,
token: &SearchToken,
store: &S,
) -> Result<Vec<Option<EncValue>>, VaultError>
pub async fn fetch_token_results<S: EncryptedStore>( &self, token: &SearchToken, store: &S, ) -> Result<Vec<Option<EncValue>>, VaultError>
Convenience: fetch all tagged entries for a token from an EDB in one call.
Sourcepub fn finalize_search(
&self,
token: &SearchToken,
enc_values: Vec<Option<EncValue>>,
) -> Result<Vec<SearchResult>, VaultError>
pub fn finalize_search( &self, token: &SearchToken, enc_values: Vec<Option<EncValue>>, ) -> Result<Vec<SearchResult>, VaultError>
Decrypt and verify the server’s response.
Each enc_values[i] corresponds to token.pairs[i].
Entries that the server reports as missing are silently skipped
(the server may have lost them; this is the “robustness” the paper addresses).
Entries that fail GCM verification return VaultError::Tampered.
Sourcepub async fn search<S: EncryptedStore>(
&self,
keyword: &str,
store: &S,
) -> Result<Vec<SearchResult>, VaultError>
pub async fn search<S: EncryptedStore>( &self, keyword: &str, store: &S, ) -> Result<Vec<SearchResult>, VaultError>
Full search: prepare token → fetch from store → decrypt results.
Equivalent to calling prepare_search + fetch_token_results +
finalize_search in sequence. Useful for single-threaded environments.