Crate sasl [] [src]

This crate provides a framework for SASL authentication and a few authentication mechanisms.

Examples

use sasl::{SaslCredentials, SaslMechanism, Error};
use sasl::mechanisms::Plain;

let creds = SaslCredentials::default()
                            .with_username("user")
                            .with_password("pencil");

let mut mechanism = Plain::from_credentials(creds).unwrap();

let initial_data = mechanism.initial().unwrap();

assert_eq!(initial_data, b"\0user\0pencil");

You may look at the tests of mechanisms/scram.rs for examples of more advanced usage.

Usage

You can use this in your crate by adding this under dependencies in your Cargo.toml:

sasl = "*"

Modules

mechanisms

Provides a few SASL mechanisms.

Structs

SaslCredentials

A struct containing SASL credentials.

Enums

ChannelBinding

Channel binding configuration.

Error

A wrapper enum for things that could go wrong in this crate.

SaslSecret

Represents a SASL secret, like a password.

Traits

SaslMechanism

A trait which defines SASL mechanisms.