#ntlm #auth #windows #kerberos


A Rust implementation of the Security Support Provider Interface (SSPI) API

18 releases (10 breaking)

0.11.0 Nov 16, 2023
0.9.0 Jul 24, 2023
0.8.0 Mar 29, 2023
0.6.0 Dec 21, 2022
0.2.0 Jul 18, 2019

#88 in Authentication

Download history 314/week @ 2023-08-13 250/week @ 2023-08-20 255/week @ 2023-08-27 236/week @ 2023-09-03 225/week @ 2023-09-10 304/week @ 2023-09-17 312/week @ 2023-09-24 270/week @ 2023-10-01 485/week @ 2023-10-08 367/week @ 2023-10-15 260/week @ 2023-10-22 316/week @ 2023-10-29 239/week @ 2023-11-05 331/week @ 2023-11-12 228/week @ 2023-11-19 337/week @ 2023-11-26

1,147 downloads per month
Used in ldap3_proto


16K SLoC


sspi-rs is a Rust implementation of Security Support Provider Interface (SSPI). It ships with platform-independent implementations of Security Support Providers (SSP), and is able to utilize native Microsoft libraries when ran under Windows.

The purpose of sspi-rs is to clean the original interface from cluttering and provide users with Rust-friendly SSPs for execution under *nix or any other platform that is able to compile Rust.


The sspi-rs works in accordance with the MSDN documentation. At the moment, NT LAN Manager (NTLM) is implemented and available for platform independent execution. It is also possible to create your own SSPs by implementing the SspiImpl trait. More on that in the Documentation.

Ease of use

Some SSPI functions tend to be cumbersome, that's why sspi-rs allows to use SSPI in a convenient way by utilizing builders. Examples are available in the examples, example section, and Documentation.


sspi-rs is included in the Cargo.toml like this:

sspi = "0.1.0"

After that you can use the types that you need.


Documentation will give you a comprehensive overlook of the crate. For the example of a simple use case, visit the examples folder.


The usage of the SSPs is as simple as creating an instance of the security provider and calling its functions.

Here is an example of acquiring a credentials handle and a timestamp of their validity:

use sspi::{Ntlm, Sspi, CredentialUse};

fn main() {
    let mut ntlm = Ntlm::new();
    let (cred_handle, timestamp) = ntlm

Example of acquiring an SSP provided by Windows:

let mut negotiate = SecurityPackage::from_package_type(

Projects that use sspi-rs


sspi-rs is licensed under MIT license.


~1M SLoC