CertificateEnrollmentManager.CreateRequestAsync 方法

定义

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

public:
 static IAsyncOperation<Platform::String ^> ^ CreateRequestAsync(CertificateRequestProperties ^ request);
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<winrt::hstring> CreateRequestAsync(CertificateRequestProperties const& request);
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<string> CreateRequestAsync(CertificateRequestProperties request);
function createRequestAsync(request)
Public Shared Function CreateRequestAsync (request As CertificateRequestProperties) As IAsyncOperation(Of String)

参数

request
CertificateRequestProperties

一个 CertificateRequestProperties 对象,该对象包含用于创建证书请求的属性值。

返回

IAsyncOperation<String>

IAsyncOperation<Platform::String>

IAsyncOperation<winrt::hstring>

此方法返回一个字符串,其中包含 base64 编码的 PKCS #10 证书请求。

属性

注解

可以在应用容器中执行证书注册。 建议使用以下请求对象提交请求:

CertificateRequestProperties 对象包含以下默认值。

Property 默认值
主题 空字符串
KeyAlgorithmName RSA
KeySize 2048 位
FriendlyName 空字符串
HashAlgorithmName SHA256
Exportable 不可导出
KeyUsages 签名
KeyProtectionLevel NoConsent
KeyStorageProviderName Microsoft 软件密钥存储提供程序

当 CreateRequestAsync 方法创建证书请求时,需要将请求提交到 http 注册终结点。 然后,可以从 http 注册终结点获取响应,然后调用 InstallCertificateAsync 方法来安装响应。

注意

必须在调用 CreateRequestAsync 时使用的任何 CertificateRequestProperties 对象的 KeyUsages 属性中包含 Signing 值。 如果要将 KeyUsages 设置为 DecryptionKeyAgreement,还必须在 “签名”中指定 OR。 否则,对 CreateRequestAsync 的调用将失败。

适用于