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 密钥存储提供程序”作为提供程序名称。

PlatformKeyStorageProvider

返回“Microsoft Platform Crypyto 密钥存储提供程序”作为提供程序名称。

SmartcardKeyStorageProvider

返回“Microsoft 智能卡密钥存储提供程序”作为提供程序名称。

SoftwareKeyStorageProvider

返回“Microsoft 软件密钥存储提供程序”作为提供程序名称。

适用于

另请参阅