Struct cerbero_lib::TicketCreds

source ·
pub struct TicketCreds {
    pub ticket_creds: Vec<TicketCred>,
}
Expand description

Struct to store a vector of TicketCred with additional functionality

Fields§

§ticket_creds: Vec<TicketCred>

Implementations§

source§

impl TicketCreds

source

pub fn new(ticket_creds: Vec<TicketCred>) -> Self

source

pub fn empty() -> Self

source

pub fn as_bytes(&self) -> Vec<u8>

source

pub fn from_bytes(vec: Vec<u8>) -> Result<Self>

source

pub fn push(&mut self, ticket_info: TicketCred)

source

pub fn iter(&self) -> Iter<'_, TicketCred>

source

pub fn is_empty(&self) -> bool

source

pub fn get(&self, index: usize) -> Option<&TicketCred>

source

pub fn filter<P>(&self, predicate: P) -> Self
where P: Fn(&TicketCred) -> bool,

source

pub fn etype(&self, etype: i32) -> Self

Filter tickets for etype

source

pub fn prealm(&self, realm: &str) -> Self

Filter tickets for prealm (realm of the client). Case insensitive.

source

pub fn pname(&self, name: &PrincipalName) -> Self

Filter tickets for pname (the name of the client). Case insensitive.

source

pub fn srealm(&self, realm: &str) -> Self

Filter tickets for srealm (realm of the service). Case insensitive.

source

pub fn sname(&self, name: &PrincipalName) -> Self

Filter tickets for sname (the name of the service). Case insensitive.

source

pub fn user_realm(&self, realm: &str) -> Self

Filter tickets for user_realm. Same as prealm. Case insensitive.

source

pub fn username(&self, name: &str) -> Self

Filter for the username.

source

pub fn user(&self, user: &KrbUser) -> Self

Filter for the username and the user realm.

source

pub fn service_name(&self, name: &str) -> Self

Filter to only return tickets that includes a given name in service. It could be the name of the service (e.g: http, cifs), the hostname or any other string that appears in the service name. Case insensitive.

source

pub fn tgt(&self) -> Self

Filter to only returns TGTs.

source

pub fn tgt_realm(&self, realm: &str) -> Self

Filter to only returns TGTs for a given realm.

source

pub fn user_tgt_realm(&self, user: &KrbUser, realm: &str) -> Self

Filter to only returns TGTs for a given realm.

source

pub fn user_service( &self, client: &KrbUser, sname: &PrincipalName, srealm: &str, ) -> Self

Filter to return tickets for an user to an specific service

source

pub fn s4u2self_tgss( &self, user: &KrbUser, impersonate_user: &KrbUser, user_service: Option<&String>, ) -> Self

Returns the s4u2self tgss.

Trait Implementations§

source§

impl Clone for TicketCreds

source§

fn clone(&self) -> TicketCreds

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TicketCreds

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<(Vec<Ticket>, Vec<KrbCredInfo>)> for TicketCreds

source§

fn from((tickets, cred_infos): (Vec<Ticket>, Vec<KrbCredInfo>)) -> Self

Converts to this type from the input type.
source§

impl From<TicketCred> for TicketCreds

source§

fn from(ticket_info: TicketCred) -> Self

Converts to this type from the input type.
source§

impl From<TicketCreds> for KrbCred

source§

fn from(ticket_creds: TicketCreds) -> KrbCred

Converts to this type from the input type.
source§

impl From<TicketCreds> for Vec<u8>

source§

fn from(tickets: TicketCreds) -> Vec<u8>

Converts to this type from the input type.
source§

impl From<Vec<TicketCred>> for TicketCreds

source§

fn from(v: Vec<TicketCred>) -> Self

Converts to this type from the input type.
source§

impl TryFrom<KrbCred> for TicketCreds

Convert from Kerberos credentials in plain text, the usual way of storing them in machines. In case the credentials are encrypted this will fail.

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(krb_cred: KrbCred) -> Result<Self>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> ErasedDestructor for T
where T: 'static,

source§

impl<T> MaybeSendSync for T