Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions mongocrypt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,17 @@ impl CryptBuilder {
Ok(self)
}

/// Set the expiration time for the data encryption key cache. Defaults to 60 seconds if not set.
pub fn key_cache_expiration(self, expiration_ms: u64) -> Result<Self> {
unsafe {
let ok = sys::mongocrypt_setopt_key_expiration(*self.inner.borrow(), expiration_ms);
if !ok {
return Err(self.status().as_error())
}
}
Ok(self)
}

pub fn build(mut self) -> Result<Crypt> {
let _guard = CRYPT_LOCK.lock().unwrap();

Expand Down