Skip to main content

Crate wintrust

Crate wintrust 

Source
Expand description

Portable catalog trust with idiomatic Rust functions and Windows-name aliases.

WinVerifyTrust is a re-export of win_verify_trust, with the same safe Rust signature. These names do not expose the Windows C ABI or inherit the machine catalog database. Policy and member format remain explicit.

use wintrust::{CryptCATAdminAcquireContext2, crypt_cat_admin_acquire_context2};
use wintrust::portable::sip::{DigestAlgorithm, MemberHashPolicy, SipKind};

let context = CryptCATAdminAcquireContext2(
    DigestAlgorithm::Sha256, SipKind::FlatXml, MemberHashPolicy::default(),
)?;
let other = crypt_cat_admin_acquire_context2(
    DigestAlgorithm::Sha256, SipKind::FlatXml, MemberHashPolicy::default(),
)?;

Re-exports§

pub use catalog_trust::portable;
pub use crypt_cat_admin_acquire_context2 as CryptCATAdminAcquireContext2;
pub use crypt_cat_admin_calc_hash_from_file_handle2 as CryptCATAdminCalcHashFromFileHandle2;
pub use crypt_cat_admin_release_context as CryptCATAdminReleaseContext;
pub use win_verify_trust as WinVerifyTrust;

Modules§

catalog
Bounded inspection of Microsoft PKCS#7 catalog CTLs. Parsing establishes no trust.
catalog_trust
Windows catalog-member trust reference. Hash matching alone is not trust.

Structs§

CatalogAdminContext
Owned portable catalog administrator context. Drop releases it automatically. Algorithm, format and bounds cannot change after acquisition.

Functions§

crypt_cat_admin_acquire_context2
Acquire a portable hashing context with an explicit algorithm and SIP format. SHA-1 requires an affirmative compatibility policy; zero bounds are invalid.
crypt_cat_admin_calc_hash_from_file_handle2
Hash a complete regular file using the context’s SIP rules. The original seek position is restored after success or verification failure. The returned bytes replace Windows’ caller-allocated output buffer.
crypt_cat_admin_release_context
Release a context by consuming ownership. Ordinary Rust drop also suffices.
win_verify_trust
Verify an explicitly supplied catalog member under the portable Rust policy. Requires every configured signature, chain, timestamp and revocation check; rejected trust is an error rather than an HRESULT or partially trusted report.