Microsoft.Security.CodeIntegrity 3.1.3

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.

Requires NuGet 2.5 or higher.

dotnet add package Microsoft.Security.CodeIntegrity --version 3.1.3
                    
NuGet\Install-Package Microsoft.Security.CodeIntegrity -Version 3.1.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Microsoft.Security.CodeIntegrity" Version="3.1.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Microsoft.Security.CodeIntegrity" Version="3.1.3" />
                    
Directory.Packages.props
<PackageReference Include="Microsoft.Security.CodeIntegrity" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Microsoft.Security.CodeIntegrity --version 3.1.3
                    
#r "nuget: Microsoft.Security.CodeIntegrity, 3.1.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Microsoft.Security.CodeIntegrity@3.1.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Microsoft.Security.CodeIntegrity&version=3.1.3
                    
Install as a Cake Addin
#tool nuget:?package=Microsoft.Security.CodeIntegrity&version=3.1.3
                    
Install as a Cake Tool

Microsoft.Security.CodeIntegrity

Microsoft.Security.CodeIntegrity provides APIs for reading, validating, and converting Windows App Control for Business policy data. The package targets .NET Framework 4.6.2, .NET 8, and .NET 9.

Breaking change in version 3

Version 3.0.0 moved the ConfigCI implementation from the inbox Microsoft.ConfigCI.Commands.dll assembly into this package. Types previously exposed from the Microsoft.SecureBoot.UserConfig namespace now use Microsoft.Security.CodeIntegrity or Microsoft.Security.CodeIntegrity.ConfigCi. Please check MIGRATION.md for more info.

This affects compiled applications and PowerShell scripts that explicitly reference the old CLR type names. PowerShell scripts that invoke ConfigCI cmdlets without explicitly naming their implementation types are generally unaffected.

Common replacements:

Old type New type
Microsoft.SecureBoot.UserConfig.Rule Microsoft.Security.CodeIntegrity.ConfigCi.Rule
Microsoft.SecureBoot.UserConfig.DriverFile Microsoft.Security.CodeIntegrity.ConfigCi.DriverFile
Microsoft.SecureBoot.UserConfig.Eku Microsoft.Security.CodeIntegrity.ConfigCi.Eku
Microsoft.SecureBoot.UserConfig.CIPolicyException Microsoft.Security.CodeIntegrity.CIPolicyException
global::SiPolicy Microsoft.Security.CodeIntegrity.SiPolicy

The old DriverFile(AppxPackage) constructor is not available. Use DriverFile(packageFamilyName, packageVersion) or the New-CIPolicyRule -Package PowerShell parameter.

The package also contains MIGRATION.md with the complete migration guidance.

Package usage

<PackageReference Include="Microsoft.Security.CodeIntegrity" Version="3.1.3" />

Example:

using Microsoft.Security.CodeIntegrity;
using System.IO;

using FileStream xmlInput = File.OpenRead(xmlPolicyPath);
using var binaryOutput = new MemoryStream();

Policy.ConvertFromCodeIntegrityPolicy(xmlInput, binaryOutput);
File.WriteAllBytes(binaryPolicyPath, binaryOutput.ToArray());

Build and test

Build the library:

dotnet build Microsoft.Security.CodeIntegrity\Microsoft.Security.CodeIntegrity.csproj -c Release

Run the tests:

dotnet test LibTests\LibTests.csproj -c Release
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Framework net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.1.4 82 9/14/2026
3.1.3 95 9/8/2026
3.1.2 132 8/11/2026
3.1.1 208 6/3/2026
3.1.0 206 5/21/2026
3.0.0 138 4/23/2026
2.1.0 107 4/10/2026
2.0.0 110 3/17/2026
1.5.1 107 2/23/2026
1.5.0 105 2/4/2026
1.3.0 392 11/17/2025
1.2.1 250 11/3/2025
1.2.0 223 10/23/2025
1.1.0 6,697 2/18/2021
1.0.1 900 7/31/2019
1.0.0 827 7/18/2019

BREAKING CHANGE introduced in 3.0.0: ConfigCI implementation types moved from
       Microsoft.ConfigCI.Commands.dll and the Microsoft.SecureBoot.UserConfig namespace
       to Microsoft.Security.CodeIntegrity.dll. Rule, DriverFile, Eku, and related types
       are now under Microsoft.Security.CodeIntegrity.ConfigCi. CIPolicyException is under
       Microsoft.Security.CodeIntegrity. No CLR type-forwarding compatibility layer is provided.
       PowerShell scripts that invoke ConfigCI cmdlets without explicitly naming CLR types are
       generally unaffected. See MIGRATION.md in the package for migration guidance.