namespace CustomBuildTool
{
///
/// Generates the per-driver SPDX 3.0 SBOM and VEX statement required for WHCP driver submissions
/// (Windows 25H2/26H1 and Windows Server 2025, starting 03/2027).
///
///
/// WHCP requires one SBOM and one VEX per INF per driver folder, named {inf_name}.spdx.json and
/// {inf_name}.vex.json and placed in a subfolder of the driver package folder. Both files must
/// be COSE signed afterwards (WDK sbom-tool); this command only produces the unsigned documents.
///
public static partial class BuildDriverSbom
{
private const string SpdxContext = "https://spdx.org/rdf/3.0.1/spdx-context.jsonld";
private const string SpdxSpecVersion = "3.0.1";
private const string CreationInfoId = "_:creationinfo";
private const string InfName = "KSystemInformer";
private const string Supplier = "Winsider Seminars & Solutions, Inc.";
private const string RepositoryUrl = "https://github.com/winsiderss/systeminformer";
public static Command CreateDriverSbomCommand()
{
var command = new Command("-sbom-driver", "Generates the WHCP SPDX 3.0 SBOM and VEX for the driver package.");
var repo = new Argument("repo") { Description = "Repository root directory" };
var arch = new Argument("arch") { Description = "Driver package architecture (x64, arm64)" };
var binaries = new Argument("binaries") { Description = "Directory containing systeminformer.sys and ksi.dll" };
var output = new Argument("output") { Description = "Driver package folder (files are written to