Class ModuleLoadGate

Assembly: redb.Tsak.Core.dll

The ONE load-boundary trust gate for module code (review 2026-09-02, К3). Before this class the
signature check lived only inside HotReloadService's scan, so startup discovery executed .tpkg
packages unverified after every process restart, and a bare .dll dropped into a watched
directory bypassed the gate entirely. Every path that is about to load module code — startup
discovery, hot-reload scans, staged validation, package reloads — must go through here.

returns the verified BYTES, and the caller opens the package
from that buffer (ModulePackage.Open(byte[], ...)) — verifying a path and then
re-reading the file gave an attacker a swap window between the check and the load.

public sealed class ModuleLoadGate

Inheritance

Object→ModuleLoadGate

Properties

SignatureRequired

public bool SignatureRequired { get; }

Methods

AllowBareDll(string)

A bare .dll carries no manifest and no detached signature, so with enforcement on it is

public bool AllowBareDll(string dllPath)

ReadVerifiedTpkg(string)

Reads a .tpkg and, when enforcement is on, verifies its detached .sig.

public byte[]? ReadVerifiedTpkg(string tpkgPath)

Constructors