CRYPTUI_VIEWCERTIFICATE_STRUCTA structure (cryptuiapi.h)
The CRYPTUI_VIEWCERTIFICATE_STRUCT structure contains information about a certificate to view. This structure is used in the CryptUIDlgViewCertificate function.
Syntax
typedef struct tagCRYPTUI_VIEWCERTIFICATE_STRUCTA {
DWORD dwSize;
HWND hwndParent;
DWORD dwFlags;
LPCSTR szTitle;
PCCERT_CONTEXT pCertContext;
LPCSTR *rgszPurposes;
DWORD cPurposes;
union {
CRYPT_PROVIDER_DATA const *pCryptProviderData;
HANDLE hWVTStateData;
};
BOOL fpCryptProviderDataTrustedUsage;
DWORD idxSigner;
DWORD idxCert;
BOOL fCounterSigner;
DWORD idxCounterSigner;
DWORD cStores;
HCERTSTORE *rghStores;
DWORD cPropSheetPages;
LPCPROPSHEETPAGEA rgPropSheetPages;
DWORD nStartPage;
} CRYPTUI_VIEWCERTIFICATE_STRUCTA, *PCRYPTUI_VIEWCERTIFICATE_STRUCTA;
Members
dwSize
The size, in bytes, of the CRYPTUI_VIEWCERTIFICATE_STRUCT structure.
hwndParent
A handle to the window that is the parent of the dialog box produced by CryptUIDlgViewCertificate.
dwFlags
This member can be one or more of the following values.
Value | Meaning |
---|---|
|
The Certification Path page is disabled. |
|
The Details page is disabled. |
|
The user is not allowed to change the properties. |
|
The user is allowed to change the properties. |
|
The Install button is disabled. |
|
The Install button is enabled. |
|
The pages or buttons that allow the user to accept or decline any decision are disabled. |
|
An untrusted root error is ignored. |
|
Known trusted stores will not be used to build the chain. |
|
A known trusted root store will not be used to build the chain. |
|
Use only when viewing certificates on remote computers. If this flag is used, the first element of rghStores must be the handle of the root store on the remote computer. |
|
Enable revocation checking with default behavior. The default behavior is to enable revocation checking of the entire certificate chain except the root certificate. Valid only if neither the pCryptProviderData nor the hWVTStateData union member is passed in. |
|
When building a certificate chain for a remote computer, warn that the chain may not be trusted on the remote computer. |
|
If this flag is set, the Copy to file button will be disabled on the Detail page. |
|
Enable revocation checking only on the leaf certificate in the certificate chain. Valid only if neither the pCryptProviderData nor the hWVTStateData union member is passed in. |
|
Enable revocation checking on each certificate in the certificate chain. Valid only if neither the pCryptProviderData nor the hWVTStateData union member is passed in.
Note Because root certificates rarely contain information that allows revocation checking, it is expected that use of this option will usually result in failure of the CryptUIDlgViewCertificate function. The recommended option is to use CRYPTUI_ENABLE_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT. |
|
Enable revocation checking on each certificate in the certificate chain except for the root certificate. This is the recommended option to use for certificate revocation checking. Valid only if neither the pCryptProviderData nor the hWVTStateData union member is passed in.
Note This flag is equivalent to CRYPTUI_ENABLE_REVOCATION_CHECKING. |
|
Disable the HTML Help button (?) in the Certificate dialog box. |
|
Disable the Issuer Statement button on the General tab of the Certificate dialog box. |
|
Disable online revocation checking. Set this flag to ensure that the CryptUIDlgViewCertificate function uses the local cache to retrieve the certificate and does not attempt to retrieve the certificate from the network.
Windows Server 2008, Windows Vista, Windows Server 2003 and Windows XP: This flag is not supported. |
szTitle
A pointer to a null-terminated string that contains the title for the window.
pCertContext
A pointer to the CERT_CONTEXT structure that contains the certificate context to display.
rgszPurposes
An array of pointers to null-terminated strings that contain the purposes for which this certificate will be validated.
cPurposes
The number of purposes in the rgszPurposes array.
pCryptProviderData
If the WinVerifyTrust function has already been called for the certificate and the WTHelperProvDataFromStateData function was also called, pass in a pointer to the state structure that was acquired from the call to WTHelperProvDataFromStateData. If pCryptProviderData is set, fpCryptProviderDataTrustedUsage, idxSigner, idxCert, and fCounterSignature must also be set.
hWVTStateData
If WinVerifyTrust has already been called for the certificate and WTHelperProvDataFromStateData was not called, pass in the hWVTStateData member of the WINTRUST_DATA structure. If hWVTStateData is set, fpCryptProviderDataTrustedUsage, idxSigner, idxCert, and fCounterSignature must also be set.
fpCryptProviderDataTrustedUsage
If WinVerifyTrust was called, this is the result of whether the certificate was trusted.
idxSigner
The index of the signer to view.
idxCert
The index of the certificate that is being viewed within the signer chain. The certificate context of this cert must match pCertContext.
fCounterSigner
TRUE if a countersignature is being viewed. If this is TRUE, idxCounterSigner must be valid.
idxCounterSigner
The index of the countersigner to view.
cStores
The number of other stores in the rghStores array of certificate stores to search when building and validating the certificate chain.
rghStores
An array of HCERTSTORE handles to other certificate stores to search when building and validating the certificate chain.
cPropSheetPages
The number of property pages to add to the dialog box.
rgPropSheetPages
An array of property pages to add to the dialog box. Each page in this array will not receive the lParam in the PROPSHEETPAGE structure as the lParam in the WM_INITDIALOG message. It will instead receive a pointer to a CRYPTUI_INITDIALOG_STRUCT structure. It contains the lParam in PROPSHEETPAGE and the pointer to the CERT_CONTEXT for which the page is being displayed.
nStartPage
The index of the initial page that will be displayed. If the highest bit (0x8000) is set, the index is assumed to index rgPropSheetPages (after the highest bit has been stripped off, for example, 0x8000 will indicate the first page in rgPropSheetPages). If the highest bit is zero, nStartPage will be the starting index of the default certificate dialog box property pages.
Remarks
Note
The cryptuiapi.h header defines CRYPTUI_VIEWCERTIFICATE_STRUCT as an alias that automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that is not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows XP [desktop apps only] |
Minimum supported server | Windows Server 2003 [desktop apps only] |
Header | cryptuiapi.h |