nt-token

Crates.iont-token
lib.rsnt-token
version0.5.0
created_at2025-07-04 15:13:43.325001+00
updated_at2025-07-07 16:16:14.423736+00
descriptionErgonomic wrapper for Windows NT access tokens
homepagehttps://github.com/eiz/nt-token
repositoryhttps://github.com/eiz/nt-token
max_upload_size
id1738128
size48,842
Mack Straight (eiz)

documentation

https://docs.rs/nt-token

README

nt-token

CI crates.io docs.rs license

AI DISCLAIMER: This project was initially generated by OpenAI "o3" language model. The compies were supervised heavily but no warranties express or implied etc etc.

Memory-safe, ergonomic helpers for working with Windows access tokens and security identifiers (SIDs) – built on top of the windows crate.

use nt_token::{OwnedToken, Sid};
use windows::Win32::Security::TOKEN_QUERY;

fn main() -> windows::core::Result<()> {
    let token = OwnedToken::from_current_process(TOKEN_QUERY)?;
    println!("elevated = {}", token.is_elevated()?);
    println!("integrity level = 0x{:x}", token.integrity_level()?);

    for g in token.groups()? {
        println!("group → {}", g);
    }
    Ok(())
}
Commit count: 0

cargo fmt