Crates.io | sspi-bobbobbio |
lib.rs | sspi-bobbobbio |
version | 0.10.1 |
source | src |
created_at | 2023-09-25 04:54:43.762513 |
updated_at | 2023-09-25 04:54:43.762513 |
description | bobbobbio's fork of A Rust implementation of the Security Support Provider Interface (SSPI) API |
homepage | https://github.com/bobbobbio/sspi-rs |
repository | https://github.com/bobbobbio/sspi-rs |
max_upload_size | |
id | 982367 |
size | 926,837 |
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.
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:
[dependencies]
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
.acquire_credentials_handle()
.with_credential_use(CredentialUse::Inbound)
.execute()
.unwrap();
}
Example of acquiring an SSP provided by Windows:
let mut negotiate = SecurityPackage::from_package_type(
SecurityPackageType::Other(String::from("Negotiate"))
);
sspi-rs is licensed under MIT license.