[−][src]Struct kerbeiros::requesters::AsRequester
Send the AS-REQ requests and retrieves the response
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(); let user_key = Key::Password("S3cr3t".to_string()); let mut as_requester = kerbeiros::AsRequester::new(realm, kdc_address); // Use AES-256 cipher as_requester.set_etype(AES256_CTS_HMAC_SHA1_96).unwrap(); let response = as_requester.request(&username, Some(&user_key)).unwrap(); match response { AsReqResponse::KrbError(krb_error) => { println!("KRB-ERROR with error code = {}", krb_error.error_code); } AsReqResponse::AsRep(as_rep) => { let ticket = as_rep.ticket; println!("Ticket obtained for service {}", ticket.sname); } }
Methods
impl AsRequester
[src]
pub fn new(realm: AsciiString, kdc_address: IpAddr) -> Self
[src]
pub fn request(
&self,
username: &AsciiString,
user_key: Option<&Key>
) -> Result<AsReqResponse>
[src]
&self,
username: &AsciiString,
user_key: Option<&Key>
) -> Result<AsReqResponse>
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 AsRequester
impl !Send for AsRequester
impl !Sync for AsRequester
impl Unpin for AsRequester
impl !UnwindSafe for AsRequester
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>,