Crate kerberos_parser
source ·Expand description
§Kerberos Parser
A Kerberos v5 (RFC4120) parser, implemented with the nom parser combinator framework.
The code is available on Github.
Specific parsing functions are provided for Kerberos message types. For ex. to parse a
KRB_AS_REQ message, use parse_as_req
.
§Examples
Parsing a KRB_AS_REQ message:
use kerberos_parser::krb5::MessageType;
use kerberos_parser::krb5_parser::parse_as_req;
static AS_REQ: &'static [u8] = include_bytes!("../assets/as-req.bin");
let res = parse_as_req(AS_REQ);
match res {
Ok((rem, kdc_req)) => {
assert!(rem.is_empty());
//
assert_eq!(kdc_req.msg_type, MessageType::KRB_AS_REQ);
},
_ => panic!("KRB_AS_REQ parsing failed: {:?}", res),
}
Modules§
- Kerberos 5 structures
- Kerberos 5 parsing functions