#ticket #kerberos #constants #protocols #server #key #tgs

kerberos_constants

Constants used by differente objects and actors of the Kerberos protocol

9 releases

0.0.9 Jan 12, 2021
0.0.8 Jan 12, 2021
0.0.6 May 31, 2020

#488 in Authentication

Download history 93/week @ 2023-12-11 155/week @ 2023-12-18 32/week @ 2023-12-25 39/week @ 2024-01-01 106/week @ 2024-01-08 154/week @ 2024-01-15 115/week @ 2024-01-22 108/week @ 2024-01-29 88/week @ 2024-02-05 74/week @ 2024-02-12 64/week @ 2024-02-19 85/week @ 2024-02-26 103/week @ 2024-03-04 71/week @ 2024-03-11 58/week @ 2024-03-18 99/week @ 2024-03-25

337 downloads per month
Used in 8 crates (7 directly)

AGPL-3.0

21KB
323 lines

Kerbeiros

Kerberos client

Concepts

  • KDC (Key Distribution Center): Service that distributes the tickets. The host that provides this server is also called KDC.
  • TGS (Ticket Granting Server): Ticket used to authenticate the user against a specified service.
  • TGT (Ticket Granting Ticket): Ticket used to retrieve the TGS's from the KDC.

Examples

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.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();

Development

Code style

Follow the rustfmt code style.

To format code:

cargo fmt

Test

To run tests:

cargo test

References


lib.rs:

Kerberos constants

This library defines the numeric constants used across the Kerberos protocol by different objects and actors.

No runtime deps