CAPI2 Diagnostics is a feature first introduced in Microsoft® Windows® Vista. This feature provides administrators with an ability to troubleshoot PKI problems by collecting detailed information about certificate chain validation, certificate store operations and signature verification. With CAPI2 Diagnostics, it is easier to identify the root cause of most PKI problems. CAPI2 Diagnostics can reduce the time required to diagnose problems and improve the troubleshooting experience.
For quick instructions on how to enable this feature, see below. To learn more about CAPI2 Diagnostics, check out the whitepaper on Troubleshooting PKI problems on Windows Vista at http://www.microsoft.com/downloads/details.aspx?FamilyID=FE8EB7EA-68DA-4331-9D38-BDBF9FA2C266
If you have questions or feedback, you can send it to capidiag@microsoft.com
You can enable this feature from the event viewer UI or use command line scripts.
You can also enable logging and save the logs using the wevtutil.exe tool.
Launch a command line with administrative privileges. Run the following commands
wevtutil.exe sl Microsoft-Windows-CAPI2/Operational /e:true
wevtutil.exe epl Microsoft-Windows-CAPI2/Operational filename.evtx
wevtutil.exe sl Microsoft-Windows-CAPI2/Operational /e:false
wevtutil.exe cl Microsoft-Windows-CAPI2/Operational
wevtutil sl Microsoft-Windows-CAPI2/Operational /ms:<log-size-in-bytes>
CAPI2 Diagnostics utilizes Event Viewer features, such as use of error level and keywords, for filtering the data in the log. For example, if you want to look at path validation related errors, you can filter by an event level of "Error" (level 2) and the keywords "chain building," "chain validation," and "revocation." Events are marked level 2 when the API returns an error and level 4 if the API returns a success.
In the default logging mode, only events with levels 2 and 4 are logged. This includes success and error events for the top-level events along with any child error events. For more detailed logging with additional information corresponding to the child events, enable the verbose logging mode. With the verbose mode, events with verbose level 5 are available in the log. For example, with verbose mode, the links to the binary X.509 objects are available in the log. X.509 objects are cached in file system at %USERPROFILE%/AppData/LocalLow/Microsoft/X509Objects.
This is logged as:
<X509Objects>
<Base path="F:\Users\abby\AppData\LocalLow\Microsoft\X509Objects”/>
Verbose mode is useful for operations that rarely fail, such are store and cache operations, but are sometimes useful to give context to other events. If the operation fails, an error event with a level of 2 will be logged and will be available in the default logging mode.
Security Developer Center
Cryptography Topics on MSDN
Follow us on Twitter