[−][src]Struct kerbeiros::requesters::TgtRequester
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]
&self,
username: &AsciiString,
user_key: Option<&Key>
) -> Result<Credential>
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
impl !RefUnwindSafe for TgtRequester
impl !Send for TgtRequester
impl !Sync for TgtRequester
impl Unpin for TgtRequester
impl !UnwindSafe for TgtRequester
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,