pub struct TicketCache { /* private fields */ }Expand description
In-memory Kerberos ticket cache.
Provides store/lookup/remove operations with automatic expiry purging.
Implementations§
Source§impl TicketCache
impl TicketCache
Sourcepub fn set_default_principal(&mut self, principal: PrincipalName)
pub fn set_default_principal(&mut self, principal: PrincipalName)
Set the default principal.
Sourcepub fn default_principal(&self) -> Option<&PrincipalName>
pub fn default_principal(&self) -> Option<&PrincipalName>
Get the default principal.
Sourcepub fn store_ticket(&mut self, entry: CcacheEntry)
pub fn store_ticket(&mut self, entry: CcacheEntry)
Store a ticket in the cache.
If a ticket for the same server principal already exists, it is replaced.
Sourcepub fn lookup_ticket(&self, server: &PrincipalName) -> Option<&CcacheEntry>
pub fn lookup_ticket(&self, server: &PrincipalName) -> Option<&CcacheEntry>
Look up a ticket by server principal.
Sourcepub fn remove_ticket(&mut self, server: &PrincipalName) -> bool
pub fn remove_ticket(&mut self, server: &PrincipalName) -> bool
Remove a ticket by server principal.
Sourcepub fn purge_expired(&mut self) -> usize
pub fn purge_expired(&mut self) -> usize
Remove all expired tickets.
Sourcepub fn list_tickets(&self) -> &[CcacheEntry]
pub fn list_tickets(&self) -> &[CcacheEntry]
List all cached tickets with metadata.
Sourcepub fn deserialize(data: &[u8]) -> Result<Self, KernelError>
pub fn deserialize(data: &[u8]) -> Result<Self, KernelError>
Import from ccache binary format.