CertificateEnrollmentManager 类

定义

表示证书注册管理器。

public ref class CertificateEnrollmentManager 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 CertificateEnrollmentManager 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 CertificateEnrollmentManager
Public Class CertificateEnrollmentManager
继承
Object Platform::Object IInspectable CertificateEnrollmentManager
属性

Windows 要求

设备系列
Windows 10 (在 10.0.10240.0 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v1.0 中引入)

示例

using Windows.Security.Cryptography.Certificates;
using System.Threading.Tasks;

namespace SampleCertificateEnrollmentManager
{

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

            // Create a certificate request.
            this.GetCertificateRequest();
        }

        public async void GetCertificateRequest()
        {
            // Create a certificate request asynchronously.
            String certificateRequest = await this.SampleCreateRequest();
        }

        public async Task<String>SampleCreateRequest()
        {
            // Create a CertificateRequestProperties object.
            CertificateRequestProperties requestProp = new CertificateRequestProperties();

            // Assign a subject name to the properties object.
            requestProp.Subject = "SampleRequest";

            // Create a certificate request.
            String strRequest = await CertificateEnrollmentManager.CreateRequestAsync(requestProp);

            // Return the request string.
            return strRequest;
        }
    }
}

注解

调用 CreateRequestAsync 方法以创建 CertificateEnrollmentManager 对象的实例。

此类仅包含静态属性。 无需创建 类的实例来检索属性。 请改用类名,后跟点运算符 (.) ,后跟属性名称。

属性

UserCertificateEnrollmentManager

获取关联的 UserCertificateEnrollmentManager

方法

CreateRequestAsync(CertificateRequestProperties)

基于 CertificateRequestProperties 对象中指定的属性异步创建 PKCS #10 证书请求。

ImportPfxDataAsync(String, String, ExportOption, KeyProtectionLevel, InstallOptions, String)

从个人信息交换异步导入证书, (PFX) 消息。

ImportPfxDataAsync(String, String, ExportOption, KeyProtectionLevel, InstallOptions, String, String)

使用指定的密钥存储提供程序从个人信息交换 (PFX) 消息异步导入证书。

ImportPfxDataAsync(String, String, PfxImportParameters)

使用导入参数从个人信息交换 (PFX) 消息异步导入证书。

InstallCertificateAsync(String, InstallOptions)

在本地计算机上的应用容器中异步安装证书链。

适用于

另请参阅