Supported TPM 2.0 NV counter provisioning and attestation on Windows

俊賢 何 0 Reputation points
2026-11-26T15:39:40.6766667+00:00

Environment:

  • Windows 10 Home 22H2, build 19045.6466

Intel PTT / TPM 2.0

OSManagedAuthLevel = 5

Standard, non-elevated Windows user

TBS communication and TPM2_GetCapability successfully verified

We are developing an application that requires hardware-backed anti-rollback protection.

The TPM reports support for NV_Increment, NV_Extend, and NV_Certify. However, we have not identified a supported Windows mechanism for provisioning and managing application-specific NV indices.

Could you please clarify the following?

Is there a supported mechanism to provision and retire an application-specific TPM 2.0 NV counter?

Can a standard Windows user read and increment that counter under a restricted TPM policy?

Can an application enroll a trusted, device-bound attestation key and obtain fresh TPM2_NV_Certify evidence through supported Windows APIs?

If provisioning requires a separate authorized system component, what component, authorization mechanism, API, or tool should be used?

Is this complete lifecycle supported on Windows 10 or Windows 11?

We do not intend to extract OwnerAuth, clear the TPM, modify firmware, bypass command restrictions, or interfere with BitLocker or Windows Hello.

We are looking for a supported implementation path, not merely confirmation that the TPM hardware implements these commands.

Official documentation or a supported implementation example would be greatly appreciated.

Thank you.Environment:

Windows 10 Home 22H2, build 19045.6466

Intel PTT / TPM 2.0

OSManagedAuthLevel = 5

Standard, non-elevated Windows user

TBS communication and TPM2_GetCapability successfully verified

We are developing an application that requires hardware-backed anti-rollback protection.

The TPM reports support for NV_Increment, NV_Extend, and NV_Certify. However, we have not identified a supported Windows mechanism for provisioning and managing application-specific NV indices.

Could you please clarify the following?

Is there a supported mechanism to provision and retire an application-specific TPM 2.0 NV counter?

Can a standard Windows user read and increment that counter under a restricted TPM policy?

Can an application enroll a trusted, device-bound attestation key and obtain fresh TPM2_NV_Certify evidence through supported Windows APIs?

If provisioning requires a separate authorized system component, what component, authorization mechanism, API, or tool should be used?

Is this complete lifecycle supported on Windows 10 or Windows 11?

We do not intend to extract OwnerAuth, clear the TPM, modify firmware, bypass command restrictions, or interfere with BitLocker or Windows Hello.

We are looking for a supported implementation path, not merely confirmation that the TPM hardware implements these commands.

Official documentation or a supported implementation example would be greatly appreciated.

Thank you.

Windows development | Windows API - Win32
0 comments No comments

2 answers

Sort by: Most helpful
  1. Nguyen Dam (WICLOUD CORPORATION) 1,830 Reputation points Microsoft External Staff Moderator
    2026-11-27T03:37:26.9533333+00:00

    Hello @俊賢 何 and thank you for your questions. 

    Based on the available public documentation and Microsoft's implementation examples, I'd like to share some information that may help clarify the available options and their limitations. 

    At the TPM specification level, application-specific NV indices can be provisioned and retired using commands such as TPM2_NV_DefineSpace and TPM2_NV_UndefineSpace. Windows provides TPM Base Services (TBS), which allows applications to submit TPM commands, although Windows may restrict certain commands and the application must still satisfy the required TPM authorization. 

    For a practical implementation reference, Microsoft's TSS.MSR NV (Windows) sample demonstrates creating, reading, writing, and removing NV indices. However, these capabilities do not, by themselves, establish a supported Windows procedure for managing the complete lifecycle of application-specific NV counters. 

    Regarding access from a standard Windows user account, the outcome depends on the NV index's attributes and the TPM authorization policy. Windows account privileges do not directly determine whether the TPM authorizes an operation, but Windows can independently restrict which TPM commands a standard user may submit. Both sets of requirements must therefore be satisfied. You may also find this TSS.MSR discussion useful, as it discusses how the TPM driver can block commands based on the caller's context. 

    For NV counter attestation, Windows provides TPM command submission through TBS, subject to those same restrictions. Microsoft's TSS.MSR C++ samples demonstrate calling TPM2_NV_Certify with a TPM signing key, NV index, and nonce. This provides an implementation reference for the TPM operation itself, but the available documentation does not establish a complete, supported Windows workflow for enrolling a trusted, device-bound attestation key, obtaining fresh NV counter evidence, and verifying that evidence. 

    As for provisioning, a separate authorized Windows component is not inherently required by the TPM command itself. Nevertheless, one possible approach would be to use a dedicated provisioning utility or privileged Windows service during initial setup. This component could use TBS to submit TPM2_NV_DefineSpace and configure the NV index with the appropriate authorization policy, leaving the application to perform only the permitted counter operations. 

    The TSS.MSR NV (Windows) sample demonstrates a similar separation between administrator-level provisioning and standard-user access. However, its provisioning implementation retrieves OwnerAuth, which you explicitly want to avoid. The available Windows documentation does not establish a supported alternative authorization mechanism for provisioning application-specific NV indices under your stated restrictions. Running with administrator privileges alone does not guarantee that Windows will permit the relevant commands or that the required TPM authorization is available. 

    With these limitations in mind, the available public documentation does not establish whether the complete lifecycle is officially supported on Windows 10 or Windows 11, or whether differences between the two versions affect this scenario. 

    As Microsoft Q&A is a community support platform, discussions here can provide guidance based on public documentation and implementation examples, but cannot establish official support guarantees for workflows that are not explicitly documented. If you need authoritative confirmation of the supported implementation path, I recommend referring to Windows Developer Support for the available technical support options. 

    I hope this helps clarify the available options and their limitations, and please feel free to let me know if anything remains unclear. If you found the information useful, I would appreciate it if you could follow this guide to accept the answer. Thank you. 

    Was this answer helpful?


  2. AI answer

    2026-11-26T15:40:52.8433333+00:00

    Windows does not publish a supported application API or implementation path that covers the complete lifecycle of defining, using, certifying, and retiring an application-specific TPM 2.0 NV counter; TBS can transport permitted raw TPM commands, but it is not an NV-index provisioning or attestation framework.

    Answers to the specific questions

    Requirement Documented Windows support
    Provision and retire an application NV counter No public Windows API or tool is documented for an application-specific lifecycle.
    Standard user reads/increments a policy-protected counter TBS is available to standard users, but only for commands allowed for that caller, and TPM authorization must independently succeed.
    Enroll a device-bound attestation key Supported for TPM-backed cryptographic keys through CNG/Platform Crypto Provider key attestation.
    Obtain fresh TPM2_NV_Certify evidence No supported high-level Windows API or complete Microsoft sample is documented here. Raw TBS submission is not equivalent to a supported CNG attestation workflow.
    Separate privileged provisioning component No Microsoft component, authorization protocol, or tool is documented for provisioning arbitrary application NV indices.
    Complete lifecycle on Windows 10 or 11 Not documented as a supported application scenario on either version.

    NV-index lifecycle

    TBS centralizes local TPM access, command scheduling, and resource sharing. Microsoft explicitly recommends higher-level Key Storage APIs for key-storage scenarios, but does not identify an equivalent high-level API for application NV storage.^1^

    NV storage and counters are also not virtualized by TBS. They must be cooperatively shared among software stacks, so TBS does not assign namespaces, prevent index collisions, or manage ownership and cleanup for an application.^2^

    The Windows hardware profile requires TPM implementations to include commands such as TPM2_NV_DefineSpace, TPM2_NV_UndefineSpace, TPM2_NV_Increment, and TPM2_NV_Read; TPM2_NV_Certify is optional. That is a hardware/compatibility requirement, not an application-level Windows support contract.^3^ Likewise, the HLK NV-storage test validates a device implementation; it is not an application provisioning API or sample.^4^

    Standard-user and command-policy boundary

    Standard users can create TBS contexts on Windows 8 and later.^5^ That does not imply permission to execute every TPM command:

    1. TBS applies a caller-specific TPM 2.0 allowlist.
    2. The TPM then evaluates hierarchy, index, password, session, and policy authorization.
    3. Either layer can reject the operation.

    On Windows 10 version 1809 and later—including Windows 10 22H2—the TPM 2.0 allowed-command set is fixed in the TPM driver and cannot be extended through registry settings. Separate command lists exist for administrator, standard-user, and AppContainer callers.^6^

    Therefore, an elevated service cannot generally make an unavailable TPM 2.0 command available by editing AllowedW8Commands. Whether each required raw command is accepted must be tested on the target Windows release and caller type, but passing such a test still does not create a documented support contract or lifecycle manager.

    OSManagedAuthLevel = 5 is the Windows 10 version 1703-and-later provisioning default. For TPM 2.0, it means Windows retains lockout authorization; it does not grant an application owner/platform hierarchy authorization or define an application NV provisioning authority.^7^

    Attestation is a separate API track

    The supported Windows application route for device-bound keys is CNG with the Microsoft Platform Crypto Provider:

    #include <windows.h>
    #include <ncrypt.h>
    
    NCRYPT_PROV_HANDLE provider = 0;
    SECURITY_STATUS status = NCryptOpenStorageProvider(
        &provider,
        MS_PLATFORM_CRYPTO_PROVIDER,
        0);
    
    if (status == ERROR_SUCCESS) {
        /* Create and use a TPM-backed CNG key here. */
        NCryptFreeObject(provider);
    }
    

    This provider creates TPM-protected keys that can be non-removable and unique to that TPM.^8^ ^9^

    TPM key attestation proves properties such as TPM residency and non-exportability.^10^ It does not expose TPM2_NV_Certify or certify an arbitrary NV counter.

    Similarly, NCryptCreateClaim/NCryptVerifyClaim create and verify key-attestation claims. The documented newer claim types are VBS-root and VBS-identity claims; they are not NV-certification wrappers.^11^ ^12^

    Practical supported design

    For a product requiring Microsoft-supported APIs, use:

    1. A non-exportable key in the Microsoft Platform Crypto Provider.
    2. CNG key attestation during enrollment.
    3. Server-issued nonces and signatures for freshness.
    4. A server-maintained monotonic version or anti-rollback state.

    That provides supported device-bound identity and freshness, but the monotonic state is server-backed rather than a private TPM NV counter.

    If an offline hardware monotonic counter plus fresh TPM2_NV_Certify is mandatory, the public documentation does not specify the required Windows authorization owner, provisioning service, collision-management rules, or supported lifecycle. That design needs a written support determination from Microsoft for the exact Windows editions and releases before treating raw TBS behavior as a supported production interface.


    References

    1. TPM Base Services
    2. Resource Virtualization
    3. TPM V2.0 Command and Signal Profile
    4. TPM 2.0 - NV Storage, Policy, Error Handling and Attestation
    5. Using TBS
    6. Command Blocking
    7. TPM Group Policy settings
    8. How Windows uses the Trusted Platform Module
    9. Opens a handle to the Microsoft Platform Crypto Provider using the NCryptOpenStorageProvider function, enabling access to TPM-backed key storage.
    10. Trusted Platform Module attestation
    11. NCryptCreateClaim function (ncrypt.h)
    12. NCryptVerifyClaim function (ncrypt.h)
    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.