Skip to main content

write_challenge_token68

Function write_challenge_token68 

Source
pub fn write_challenge_token68(
    scheme: &str,
    token68: &[u8],
    out: &mut impl Sink,
) -> Result<(), WriteError>
Expand description

Writes a challenge with a token68: Negotiate <token68>.

§Errors

WriteError::NotToken for the scheme; WriteError::Forbidden when token68 is not a token68; WriteError::Full.

§Examples

use parse_net::{auth, SliceSink};

let mut buf = [0u8; 32];
let mut out = SliceSink::new(&mut buf);
auth::write_challenge_token68("Negotiate", b"YIIB==", &mut out).expect("room");
assert_eq!(out.written(), b"Negotiate YIIB==");