What is diffrent beween CNG and Microsoft Key storage provider?

SUBRAMANIAN Prabhakaran 1 Reputation point
2021-11-29T08:17:00.92+00:00

Hi Team,

I have gone through the below link about CNG and Key Storage Provider.

https://learn.microsoft.com/en-us/windows/win32/seccng/key-storage-and-retrieval

I did not get clear view of these sections.

What is CNG? and what is different between CNG and Key Storage Provider?
Can i protect a file(like text file,ini file data etc..) by using Key Storage Provider? if it is possible how can i implement it in C#.Net?

Regards,
Prabhakaran

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,389 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,100 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,109 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Xiaopo Yang - MSFT 11,081 Reputation points Microsoft Vendor
    2021-11-29T09:51:46.11+00:00

    Encrypt the whole file data which is the equivalent of rgbPlaintext or Sign the file hash and then Verify the signature. Using CNG is the same as Calling Native Functions from Managed Code.
    And In my opinion, CNG is a set of APIs which provide a abstract model for private key storage.
    Have a look at SignHash which calls NCryptOpenStorageProvider. As far as I see, StorageProvider provides some services.

    0 comments No comments