kerberos_parser/lib.rs
1//! # Kerberos Parser
2//!
3//! A Kerberos v5 ([RFC4120]) parser, implemented with the [nom](https://github.com/Geal/nom)
4//! parser combinator framework.
5//!
6//! The code is available on [Github](https://github.com/rusticata/kerberos-parser).
7//!
8//! Specific parsing functions are provided for Kerberos message types. For ex. to parse a
9//! KRB_AS_REQ message, use [`parse_as_req`](krb5_parser/fn.parse_as_req.html).
10//!
11//! # Examples
12//!
13//! Parsing a KRB_AS_REQ message:
14//!
15//! ```rust,no_run
16//! use kerberos_parser::krb5::MessageType;
17//! use kerberos_parser::krb5_parser::parse_as_req;
18//!
19//! static AS_REQ: &'static [u8] = include_bytes!("../assets/as-req.bin");
20//!
21//! # fn main() {
22//! let res = parse_as_req(AS_REQ);
23//! match res {
24//! Ok((rem, kdc_req)) => {
25//! assert!(rem.is_empty());
26//! //
27//! assert_eq!(kdc_req.msg_type, MessageType::KRB_AS_REQ);
28//! },
29//! _ => panic!("KRB_AS_REQ parsing failed: {:?}", res),
30//! }
31//! # }
32//! ```
33//!
34//! [RFC4120]: https://tools.ietf.org/html/rfc4120
35
36#![deny(/*missing_docs,*/unsafe_code,
37 unstable_features,
38 unused_import_braces, unused_qualifications)]
39
40pub mod krb5;
41pub mod krb5_parser;
42
43pub mod krb5_constants;
44mod krb5_errors;
45pub use krb5_errors::*;