共用方式為


KeyStorageProviderNames 類別

定義

定義數個常用的金鑰儲存體提供者名稱。 您可以在CertificateRequestProperties類別的KeyStorageProviderName屬性中使用這個類別。

public ref class KeyStorageProviderNames abstract sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class KeyStorageProviderNames final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public static class KeyStorageProviderNames
Public Class KeyStorageProviderNames
繼承
Object Platform::Object IInspectable KeyStorageProviderNames
屬性

Windows 需求

裝置系列
Windows 10 (已於 10.0.10240.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v1.0 引進)

範例

using Windows.Security.Cryptography.Certificates;

namespace SampleKeyStorageProviderNames
{

    sealed partial class KspNamesApp : Application
    {
        public KspNamesApp()
        {
            // Initialize the application.
            this.InitializeComponent();

            // Demonstrate how to retrieve and set the key storage provider name.
            this.SampleKspNames();
        }

        public void SampleKspNames()
        {
            // Create a new CertificateRequestProperties object.
            CertificateRequestProperties reqProperties = new CertificateRequestProperties();

            // Retrieve the default value ("Microsoft Software Key Storage Provider").
            String strDefaultName = reqProperties.KeyStorageProviderName;

            // Set the value to "Microsoft Platform Crypto Provider".
            reqProperties.KeyStorageProviderName = KeyStorageProviderNames.PlatformKeyStorageProvider;

            // Set the value to "Microsoft Smart Card Key Storage Provider".
            reqProperties.KeyStorageProviderName = KeyStorageProviderNames.SmartcardKeyStorageProvider;
        }
    }
}

備註

這個類別只包含靜態屬性。 您不需要建立 類別的實例,即可擷取屬性。 請改用類別名稱,後面接著點運算子 (.) ,後面接著屬性名稱。

屬性

PassportKeyStorageProvider

傳回 「Microsoft Passport Key Storage Provider」 作為提供者名稱。

PlatformKeyStorageProvider

傳回 「Microsoft Platform Crypyto 金鑰儲存體提供者」做為提供者名稱。

SmartcardKeyStorageProvider

傳回「Microsoft 智慧卡金鑰儲存提供者」作為提供者名稱。

SoftwareKeyStorageProvider

傳回「Microsoft 軟體金鑰儲存提供者」做為提供者名稱。

適用於

另請參閱