https://github.com/eiz/nt-token
https://github.com/eiz/nt-token
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/eiz/nt-token
- Owner: eiz
- Created: 2025-07-04T04:37:54.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-07-04T06:16:32.000Z (about 1 year ago)
- Last Synced: 2025-07-04T07:19:47.051Z (about 1 year ago)
- Language: Rust
- Size: 10.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# nt-token
[](https://github.com/eiz/nt-token/actions/workflows/ci.yml)
[](https://crates.io/crates/nt-token)
[](https://docs.rs/nt-token)
[](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.
```rust
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(())
}
```