[][src]Struct kerbeiros::requesters::TgtRequester

pub struct TgtRequester { /* fields omitted */ }

Gets a TGT from KDC by sending one or more AS-REQ requests

Examples

use kerbeiros::*;
use ascii::AsciiString;
use std::net::*;

// Prepare the arguments
let realm = AsciiString::from_ascii("CONTOSO.COM").unwrap();
let kdc_address = IpAddr::V4(Ipv4Addr::new(192, 168, 0, 1));
let username = AsciiString::from_ascii("Bob").unwrap();
// Use the NTLM hash of the user password
let user_key = Key::from_rc4_key_string("B11A1D9A93E104CD7A5E256C78273437").unwrap();

// Request the TGT
let mut tgt_requester = TgtRequester::new(realm, kdc_address);
let credential = tgt_requester.request(&username, Some(&user_key)).unwrap();

// Save the ticket into a Windows format file
credential.clone().save_into_krb_cred_file("bob_tgt.krb");

// Save the ticket into a Linux format file
credential.save_into_ccache_file("bob_tgt.ccache");

Methods

impl TgtRequester[src]

pub fn new(realm: AsciiString, kdc_address: IpAddr) -> Self[src]

pub fn request(
    &self,
    username: &AsciiString,
    user_key: Option<&Key>
) -> Result<Credential>
[src]

pub fn etypes(&self) -> &HashSet<i32>[src]

pub fn set_etype(&mut self, etype: i32) -> Result<()>[src]

pub fn set_etypes(&mut self, etypes: HashSet<i32>) -> Result<()>[src]

pub fn kdc_options(&self) -> u32[src]

pub fn realm(&self) -> &AsciiString[src]

pub fn set_transport_protocol(&mut self, transport_protocol: TransportProtocol)[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.