Crates.io | himmelblau_kerbeiros |
lib.rs | himmelblau_kerbeiros |
version | 0.4.1 |
source | src |
created_at | 2024-06-21 19:52:59.975142 |
updated_at | 2024-07-03 17:45:57.096357 |
description | Kerberos client library |
homepage | |
repository | https://github.com/himmelblau-idm/kerbeiros |
max_upload_size | |
id | 1279887 |
size | 251,490 |
Kerberos client
Asking for a TGT:
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());
// Request the TGT
let 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").unwrap();
// Save the ticket into a Linux format file
credential.save_into_ccache_file("bob_tgt.ccache").unwrap();