大网数据广告活动
账户与安全

CryptUIDlgSelectCertificate function

· 52CE 我爱测

Displays a dialog box that allows a user to select a certificate.

The CryptUIDlgSelectCertificate function displays a dialog box that allows a user to select a certificate.

Syntax

PCCERT_CONTEXT WINAPI CryptUIDlgSelectCertificate(
  _In_  PCCRYPTUI_SELECTCERTIFICATE_STRUCT pcsc
);

Parameters

pcsc [in]

A pointer to a CRYPTUI_SELECTCERTIFICATE_STRUCT structure that contains information about the dialog box to display.

Return value

A pointer to a CERT_CONTEXT structure that represents the certificate selected by the user. When you have finished using this certificate, you must pass this pointer to the CertFreeCertificateContext function to decrement the reference count of the certificate context.

If the dwFlags member of the pcsc structure does not contain the CRYPTUI_SELECTCERT_MULTISELECT flag, a return value of NULL means that the user closed the dialog box without selecting a certificate.

If the dwFlags member of the pcsc structure does contain the CRYPTUI_SELECTCERT_MULTISELECT flag, this function always returns NULL. The selected certificates will be contained in the certificate store that is represented by the hSelectedCertStore member of pcsc. If the number of certificates in the store is the same before and after calling CryptUIDlgSelectCertificate, the user closed the dialog box without selecting any certificates.

Remarks

If the dwFlags member of the CRYPTUI_SELECTCERTIFICATE_STRUCT structure is set to CRYPTUI_SELECTCERT_LEGACY, the legacy dialog is displayed. Otherwise, the current certificate selection dialog is displayed.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
End of support Windows 7 [desktop apps only]
Library Cryptui.lib
DLL Cryptui.dll
Unicode and ANSI names CryptUIDlgSelectCertificateW (Unicode) and CryptUIDlgSelectCertificateA (ANSI)

See also

CRYPTUI_SELECTCERTIFICATE_STRUCT

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/29/2020
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。