Himani Joshi

Category
PKI
Updated
Apr 24, 2026
Tag
Certutil · Public key infrastructure
Focus
Hidden switches

14 min read · 10 sections

Explore More By Author

Exploring the hidden switches of Certutil and Certreq

Over the past 20 years, certutil.exe and certreq.exe have been two of the most dependable Windows toolkits. These tools have proved essential for handling cryptographic keys and certificates, especially in server contexts where security is critical. It is no secret that the fundamental use of these tools exposes a wide range of powerful capabilities.

Beyond their commonly used features, however, lies a deeper set of advanced capabilities and lesser-known switches designed for administrators who need fine-grained control over certificate requests and issuance. In this guide, we will walk through these often-overlooked features and uncover the hidden switches that unlock the full potential of these tools.

Quick Answer: What Are Certutil and Certreq Hidden Switches?

Certutil and certreq hidden switches are advanced command-line parameters in certutil.exe and certreq.exe that are not shown in standard help output. They are revealed by running the case-sensitive -uSAGE flag. Certutil exposes 24 additional switches for Active Directory PKI management, HSM diagnostics, and CNG configuration. Certreq exposes 5 additional switches including direct hardware provider import via -ImportPFX.

Key Takeaways

  • The -uSAGE flag (case-sensitive) is the key to revealing hidden switches in both certutil and certreq. Combined with -v for certutil (certutil -v -uSAGE), it produces the most complete help output with full syntax. Without it, 24 certutil switches and 5 certreq switches remain completely invisible.
  • Hidden switches are undocumented by design and may behave differently across Windows Server versions. They fall outside standard Microsoft support. Always test them in a non-production environment before deploying against a live or critical CA. Switches like -dsDel, -delkey, and -SetCATemplates are irreversible and can permanently remove Active Directory PKI objects or restrict CA template issuance.
  • The -csplist and -csptest pair is the fastest way to diagnose HSM and smart card provider issues: if the provider does not appear in -csplist, the driver is not registered; if it appears but -csptest fails, the issue is permissions, PIN, or library path. This workflow replaces hours of vendor-call troubleshooting with a structured two-step diagnosis.
  • The -v -dstemplate combination is the correct command for certificate template security auditing. Without -v, you get template names. With it, you get the full expansion including enrollment flags, private key flags, issuance policies, and EKU OIDs, which is what is needed to identify ESC1 through ESC16 misconfigurations in AD CS environments.
  • Certutil -importPFX and certreq -ImportPFX serve different purposes. Use certutil for standard Windows certificate store imports with modifier control. Use certreq when importing directly into a named hardware provider, HSM KSP, or specific smart card reader, since certreq targets the provider by name rather than by Windows store.

Who Should Care About Certutil and Certreq Hidden Switches

These hidden switches are primarily a PKI administrator tool, but the operational and security implications touch multiple teams. Every role below has a reason to understand what these switches can do and where their guardrails need to be set.

RoleWhy It MattersAction Item
PKI AdminsOwn day-to-day certutil and certreq operations: CA health checks, template audits via -v -dstemplate, CRL and AIA validation via -URL, database cleanup, and HSM diagnostics via -csplist and -csptest; the hidden switches are the primary toolset for advanced AD CS troubleshootingLearn and test all 24 certutil hidden switches and 5 certreq hidden switches in a lab environment; build a diagnostic runbook mapping common AD CS failure scenarios to the correct hidden switch; confirm that CertSecure Manager CLM inventory is current so template and enrollment data from -dstemplate audits can be cross-referenced
Security ArchitectsOwn the policy governing which hidden switches are approved for production use without change control; -dsDel, -delkey, and -SetCATemplates are irreversible and require formal authorization; -v -dstemplate is the diagnostic tool for ESC1 through ESC16 certificate template misconfiguration auditingDefine and document which hidden switches require change control approval before production use; include certutil -v -dstemplate output in quarterly certificate template security audits alongside Locksmith and PSPKIAudit; review CBOM Secure cryptographic inventory alongside template audit findings
Active Directory TeamsOwn PKI container object management in Active Directory; the -ds, -dsDel, -dsCert, -dsCRL, and -dsTemplate switches operate directly on AD PKI objects and require AD admin coordination; accidental deletion via -dsDel removes objects permanently without MMC confirmation promptsRequire AD team sign-off before any -dsDel, -dsAddTemplate, or -SetCATemplates operations in production; confirm AD PKI container backups are available before any hidden switch operation that modifies AD objects
Compliance TeamsMust demonstrate that CA configuration changes were performed via authorized switches with documented before/after state; CA audit log entries for template modifications (Event ID 4899/4900) and key deletions must be retained as audit evidenceInclude certutil -v -dstemplate baseline output in quarterly compliance evidence; confirm CA audit logging is enabled (certutil -setreg ca\auditfilter 127); document the approved switch policy as a PKI operational control
CISOsThe hidden switches include capabilities that can permanently alter CA trust configuration; without a defined policy on which switches require change control, a single misconfigured -SetCATemplates or -dsDel can disrupt certificate issuance across the enterpriseRequire a formal certutil/certreq switch authorization policy as part of PKI governance documentation; fund PKI admin training on hidden switch capabilities and guardrails; include AD CS configuration change events in SIEM monitoring

Prerequisites, Commands, Validation Checks, and Rollback by Switch Category

Use this table before running hidden switches in a production environment. Each row maps a switch category to its prerequisite, the exact command, the validation check that confirms correct operation, the common error to watch for, the rollback action, and the responsible owner.

Switch CategoryPrerequisiteCommandValidation CheckCommon ErrorRollbackOwner
Reveal hidden switchescertutil.exe available (included in Windows by default); admin promptcertutil -v -uSAGE (most complete) or certutil -uSAGE (names only)Output is significantly longer than certutil -?; additional switches appear that are absent from standard helpFlag typed in lowercase (-usage) returns standard help; must be -uSAGE (case-sensitive)N/A — read-only operationPKI Admin
Template auditing (-dstemplate)AD CS installed; domain-joined machine; user has Read access to AD PKI containerscertutil -v -dstemplate (all templates) or certutil -v -dstemplate WebServer (single template)Output includes msPKI-Certificate-Name-Flag, msPKI-Private-Key-Flag, pKIExtendedKeyUsage, and msPKI-Enrollment-Flag values for each templateAccess denied: user lacks Read rights to CN=Certificate Templates in AD; requires domain user with PKI Read access at minimumN/A — read-only operationPKI Admin / Security Architect
HSM/CSP diagnostics (-csplist, -csptest)HSM or smart card vendor driver registered as a CSP or KSP on the machine; admin promptcertutil -csplist then certutil -csptest "ProviderName"Target provider appears in -csplist output; -csptest returns success without access denied or provider not found errorsProvider absent from -csplist: driver not registered, reinstall vendor driver; -csptest fails: PIN or permission issue, check HSM authentication configurationN/A — read-only diagnostic; if driver reinstall causes issues, restore from system snapshotPKI Admin
CRL/AIA URL validation (-URL)Network access to CRL and AIA endpoints from the CA server; certutil hidden switch availablecertutil -URL <CertificateFile> or certutil -URL <CRLFile>All CDP and AIA URLs return reachable status; CRL download succeeds and signature validates; OCSP responder returns a valid responseURL unreachable: firewall rule blocking the CRL or AIA port; CRL signature invalid: intermediate CA key mismatch; OCSP timeout: responder is down or misconfiguredN/A — read-only; resolve firewall or publication issue separatelyPKI Admin
AD PKI object deletion (-dsDel)Domain Admin or Enterprise Admin rights; AD PKI container backup completed; change control approval obtained; non-production test completedcertutil -dsDel <ObjectDN>Object no longer appears in certutil -ds output; no unexpected enrollment failures reported in CA event log after deletionWrong DN specified: permanently deletes the wrong AD PKI object with no recovery from certutil; no confirmation prompt is shown before deletionRestore deleted AD object from AD Recycle Bin if enabled; or restore from AD backup; no certutil rollback existsPKI Admin + AD Team (joint authorization)
CA template restriction (-SetCATemplates)CA Administrator rights; current template list documented via certutil -catemplates; change control approvalcertutil -SetCATemplates +TemplateName (add) or certutil -SetCATemplates -TemplateName (remove)certutil -catemplates reflects the intended template list; test enrollment from a client machine confirms the expected templates are available and no unintended templates are blockedWrong template name: intended template removed, causing enrollment failures for dependent systems; verify template names exactly before runningRe-add removed templates via certutil -SetCATemplates +TemplateName; restore full template list from the pre-change baselinePKI Admin
certreq -ImportPFX (HSM import)HSM KSP registered and confirmed via certutil -csplist; PFX file accessible; admin prompt; non-production test completedcertreq -ImportPFX PFXFile "ProviderName"Certificate appears in the target HSM key container; key operations (signing, encryption) succeed using the imported key via the named providerProvider not found: HSM driver not registered; PIN failure: authentication to HSM failed; use certutil -csplist to confirm provider name spelling and availability before runningDelete the imported key container from the HSM using the vendor management tool; do not use certutil -delkey on HSM containers without vendor guidancePKI Admin

Certutil.exe

Certutil.exe is a powerful command-line tool built into Windows that is used for managing, troubleshooting, and validating Public Key Infrastructure (PKI) components. Widely used by PKI administrators, security engineers, and system administrators, it supports a broad range of certificate-related operations, including managing and inspecting certificate stores, verifying certificate chains and key pairs, checking revocation status via Certificate Revocation List (CRL) and Online Certificate Status Protocol (OCSP), encoding and decoding files, hashing files, configuring Certificate Authority (CA) registry settings, interacting with Active Directory PKI containers, converting certificates between different formats, and troubleshooting certificate enrollment or trust issues. Because of its extensive functionality and flexibility, certutil.exe has become one of the most essential tools for working with Microsoft PKI environments.

To visit the official documentation, follow the link: certutil documentation

Exploring Certutil

Beyond certificate operations, certutil.exe can be used to back up and restore CA components, display configuration information for CAs, and set up Certificate Services.

One behavior worth understanding is that when certutil is run without any parameters on a Certification Authority (CA) server, it displays information about the local CA configuration. On a non-CA machine, it defaults to the equivalent of certutil -dump. Understanding this difference is important when analyzing certutil output during troubleshooting or log review.

certutil parameter switch

The certutil provides a wide range of switches, which can be explored using certutil -? or certutil -?. Adding the -v flag enables verbose output (certutil -v -?), which expands the help view to include additional commands and more detailed usage information.

Well, you might be thinking about what major difference “-v” switch could make, so here is the output of a string compared between certutil -? and certutil -v -?

certutil command left right

The left side shows the output of the command “certutil -?“, while the right side shows the output of the command “certutil -v -?“. The difference is immediately noticeable. The verbose output is significantly longer, expanding well beyond the concise list returned by certutil -?. While the default help focuses on commonly used commands with brief descriptions, adding the -v switch significantly expands the output to include additional commands and more detailed information. This clearly illustrates how much functionality within certutil.exe remains hidden unless verbose help is explicitly requested.

Exploring Hidden Switches of Certutil

The most complete way to explore everything certutil offers is with the following flag combination:

certutil -v -uSAGE

This combines verbose output (-v) with the extended usage view (-uSAGE), producing the most detailed help output with full syntax and additional commands not shown in standard help.

If you only need the list of hidden switch names without full syntax detail, the following command provides a quicker subset:

certutil -uSAGE

It is worth noting that both flags are case-sensitive and must be typed exactly as shown. Additionally, the hidden switches across both certutil and certreq are undocumented for a reason, as they may behave differently across Windows versions and fall outside the scope of standard Microsoft support. For this reason, it is always advisable to test them in a non-production environment before deploying them in any live or critical system.

Let us analyze the difference between the two in detail. On the left, we have the standard certutil -? output, while on the right we have the certutil -uSAGE output. The comparison clearly highlights additional hidden switches, which are not visible in the default help. These extra options are highlighted in green in the -uSAGE view for better identification.

Comparision image of certutil -? and certutil -v -?
Comparision image of certutil -? and certutil -v -?
Comparision image of certutil -? and certutil -v -?
Hidden Switches Of Certreq

Now that the differences are clearly visible, let us understand each additional command available under certutil -uSAGE in detail. The following table breaks down each hidden switch and its purpose for better clarity.

ParameterDescription
-encodehexEncodes a file in hexadecimal format.
-getconfig2Gets the default CA configuration string via ICertGetConfig interface.
-getconfig3Gets CA configuration via the ICertConfig interface.
-CAPropInfoDisplays CA Property Type information, such as the data types and flags of every property the CA exposes. Used for advanced CA scripting.
-exportPFXExports a certificate and its private key to a PFX file.
-TPMInfoDisplays Trusted Platform Module (TPM) information. Shows TPM version, manufacturer, and capabilities, useful when deploying TPM-backed keys. Used for TPM-backed key and Virtual Smart Card (VSC) validation.
-getcertOpens a certificate selection UI to pick a certificate interactively. The full syntax is certUtil [Options] -getcert [ObjectId | ERA | KRA [CommonName]] .
-dsDisplays Active Directory Distinguished Names (DNs) for PKI containers (AIA, CDP, etc.). Helps understand where PKI objects are stored in AD.
-dsDelDeletes a specific entry from an Active Directory PKI container. Use with extreme caution as it removes AD objects permanently.
-dsCertDisplays certificates stored in Active Directory PKI containers.
-dsCRLDisplays CRLs (Certificate Revocation Lists) stored in Active Directory.
-dsDeltaCRLDisplays Delta CRLs stored in Active Directory. Used when a CA publishes incremental revocation lists.
-dsTemplateDisplays certificate template attributes from Active Directory. Add -v before it to fully expand enrollment flags, private key flags, issuance policies, and EKU OIDs. Used for template auditing and security review.
-dsAddTemplateAdds certificate templates to Active Directory. Used during CA setup or when publishing new templates.
-SetCATemplatesSets or restricts the list of templates a CA is allowed to issue.
-URLVerifies certificate and CRL (Certificate Revocation List) URLs to ensure they are reachable and return valid data. Helps troubleshoot chain, CRL, and OCSP reachability issues.
-SCDumpDumps smart card file information. Used for smart card login and provisioning issues.
-keyLists all cryptographic key containers on the machine. Shows both CryptoAPI (legacy) and CNG key containers.
-delkeyDeletes a specific cryptographic key container from the machine (permanently).
-csplistLists all Cryptographic Service Providers (CSPs) and Key Storage Providers (KSPs) installed on the machine. Useful for verifying HSM/smart card provider availability.
-csptestTests a CSP/KSP by loading it and checking cryptographic operations. Commonly used for HSM and smart card troubleshooting.
-CNGConfigDisplays CNG (Cryptography Next Generation) configuration, such as registered algorithms, providers, and CNG settings.
-ClassDisplays COM registry information for certificate-related COM classes.
-7fChecks a certificate for 0x7f length encodings.
-getsmtpinfoDisplays SMTP(email) notification settings configured on the CA.
-setsmtpinfoConfigures SMTP notification settings on the CA such as set up email alerts for CA events like certificate issuance, expiration, or failures.

Note: These commands operate at a sensitive administrative level. Improper use of switches like -dsDel, -delkey, or -SetCATemplates can impact certificate services, break trust chains, or remove critical PKI objects from Active Directory. Always verify the target and understand the impact before running them in a production environment.

That said, let us take a closer look at some of the most commonly used hidden switches, the ones that PKI administrators will find most useful in day-to-day operations and troubleshooting.

  • -csplist and -csptest: These two work best together. Run -csplist first to see every CSP and KSP registered on the machine, then use -csptest to load and verify a specific provider. This is the fastest way to diagnose HSM or smart card issues: if the provider does not appear in -csplist, the driver is not registered; if it appears but -csptest fails, the issue is permissions, PIN, or library path. Each switch can also be expanded individually for more detail:
    certutil -v -csplist -?
    certutil -v -csptest -?
  • -dstemplate with -v: Adding -v before -dstemplate makes a significant difference. Without it, you get template names. With it, you get the full expansion, including enrollment flags, private key flags, issuance policies, and EKU OIDs. This is the command to run when auditing templates for security misconfigurations:
    certutil -v -dstemplate
    certutil -v -dstemplate WebServer

Another thing worth knowing is that every hidden switch, just like public ones, can be expanded individually. This works for any switch in the -uSAGE list:

certutil -URL -?
certutil -v -SCDump -?

Taken together, these switches give PKI administrators a level of visibility and control that simply is not available through the MMC console or standard certutil help. The more familiar you are with them, the faster you will be able to diagnose and resolve issues in your PKI environment.

Certreq.exe

Certreq.exe is a powerful command-line tool built into Windows for managing the full certificate enrollment lifecycle. While certutil.exe handles certificate inspection and CA administration, certreq.exe focuses on the request side: generating, submitting, retrieving, and installing certificates from a CA.

To visit the official documentation, follow the link: certreq documentation

Exploring Certreq

At its core, certreq.exe is the bridge between a certificate requester and a CA. It handles every stage of the enrollment workflow from a single command-line interface, making it especially valuable in server environments where GUI-based enrollment is unavailable or impractical.

Here is what certreq can do and how each capability fits into real-world PKI operations:

  • Request a certificate from a CA: Using an INF policy file, certreq generates a Certificate Signing Request (CSR) and private key pair. The INF file defines the subject, key algorithm, key size, intended usage, and any requested extensions, giving administrators precise control over what gets requested.
    certreq -new request.inf request.csr
  • Submit a request to a CA: Once a CSR is ready, certreq submits it directly to an enterprise CA over RPC/DCOM or to an external CA via a file. The -config flag specifies which CA to target when multiple CAs exist in the environment.
    certreq -submit -config "ServerName\CAName" request.csr issued.cer
  • Retrieve a pending certificate: When a CA requires manager approval, the certificate is not issued immediately. certreq can poll the CA and retrieve the issued certificate once it has been approved, using the request ID returned at submission time.
    certreq -retrieve -config "ServerName\CAName"  issued.cer
  • Accept and install the issued certificate: After retrieval, certreq installs the certificate into the appropriate Windows certificate store and links it to its private key, completing the enrollment process.
    certreq -accept issued.cer
  • Create a cross-certification or qualified subordination request: For organizations building PKI hierarchies, certreq can construct cross-certification requests from an existing CA certificate. This is used when establishing trust between two independent PKI hierarchies or when creating a qualified subordinate CA with constrained name spaces and policy constraints.
  • Sign a cross-certification or qualified subordination request: certreq can also sign a pending cross-certification request using an existing CA certificate, completing the trust establishment between PKI hierarchies without needing the MMC CA console.

Certreq Command Parameters

ParameterDescription
-submitSubmits a request to a certificate authority
-retrieve Retrieves a response to a previous request from a certificate authority
-newCreates a new request from an .inf file
-acceptAccepts and installs a response to a certificate request
-policySets the policy for a request
-signSigns a cross-certification or qualified subordination request
-enrollEnrolls for or renews a certificate
-?Displays a list of certreq syntax, options, and descriptions
-?Displays help for the parameter specified
-v -?Displays a verbose list of the certreq syntax, options, and descriptions

Among these, -submit and -retrieve are the most frequently used switches to submit a certificate request and retrieve the issued certificates from Certificate Authority via the command line.

Enterprise PKI Services

Get complete end-to-end consultation support for all your PKI requirements!

Learn More

Exploring Hidden Switches of Certreq

Just like certutil, certreq has its own set of hidden switches, revealed using the same case-sensitive -uSAGE parameter:

certreq.exe -uSAGE

The screenshots below compare the certreq -? output on the left with the standard certreq -uSAGE output on the right. The additional hidden switches are visible only on the right.

Hidden Switches Of Certreq
Hidden Switches Of Certreq
Hidden Switches Of Certreq
Hidden Switches Of Certreq

With the differences established, let us examine each additional command available under certreq -uSAGE in detail. The following table breaks down each hidden switch and its purpose for better clarity.

Hidden SwitchWhat It Does
-EOBOStarts the Enroll-On-Behalf-Of wizard. Allows an enrollment agent to request certificates on behalf of another user. Requires an enrollment agent certificate to be configured.
-EnrollXEnrolls for multiple certificates in a single operation. Accepts -Accept user and -machine flags to control the target certificate store.
-AutoEnrollStarts the Auto-Enroll UI. Supports -v, -user, and -machine flags.
-RequestCreates a custom certificate request with extended control over request content. Supports -user and -machine context flags.
-ImportPFXImports a PFX file directly to a specified cryptographic provider, including hardware providers like HSMs and smart cards.

Each of these can be expanded individually for full syntax:

certreq -ImportPFX -?
certreq -AutoEnroll -?
certreq -EOBO -?

Of these, -ImportPFX deserves a closer look, particularly because of how it differs from its counterparts in certutil.

-ImportPFX in Certreq vs -importPFX in Certutil

Of all the hidden switches, certreq -importPFX and certutil -importPFX are particularly interesting to examine. Although both work with PFX files, they serve different purposes and behave quite differently in practice.

The key difference is in how they target the destination. certutil -importPFX operates against named Windows certificate stores and offers a rich modifier list, including AT_SIGNATURE, AT_KEYEXCHANGE, NoExport, NoChain, NoRoot, Protect, ProtectHigh, Pkcs8, VSM, and more, giving fine-grained control over exactly how the certificate and key are imported.

certutil [options] -importPFX [CertificateStoreName] PFXFile [Modifiers]
certutil importPFX command
Figure represents output of certutil -importPFX command run with “-?” switch

certreq -ImportPFX, on the other hand, targets a specific cryptographic provider directly by name, including hardware providers like HSMs and smart card readers. Its syntax is positional rather than modifier-based:

certreq -ImportPFX PFXFile [Provider [Reader [ContainerPrefix [FriendlyName [Flags]]]]]
certreq importpfx cmd
Figure represents output of certreq -ImportPFX command run with “-?” switch

Note: The -importPFX option in certutil is a fully documented and supported switch. In contrast, -ImportPFX in certreq is not listed in standard help output and is considered an undocumented or lesser-known capability. Use the latter with caution and always validate behavior in non-production environments.

In practice, use certutil -importPFX for standard Windows certificate store imports where modifier control matters. Use certreq -ImportPFX when importing directly into a named hardware provider, an HSM KSP, or a specific smart card reader.

How Encryption Consulting Can Help

Encryption Consulting provides specialized services tailored to identify vulnerabilities and mitigate risks through PKI Services. Our strategic guidance aligns PKI solutions with organizational objectives, enhancing efficiency and minimizing costs. By partnering with Encryption Consulting, organizations can unlock the full potential of PKI solutions, realizing tangible financial benefits while maintaining strong security measures.

Encryption Consulting’s PKIaaS provides a flexible and secure PKI solution tailored to your specific needs, offering benefits such as customizable options, high assurance standards, and a low-risk managed approach. PKIaaS automates key and certificate management tasks, reducing operational overhead and minimizing the risk of human error. Additionally, it enhances network visibility by requiring certificates for access. It will take care of building the PKI infrastructure to lead and manage the PKI environment (cloud, hybrid, or on-premises) of your organization.

CertSecure Manager has a comprehensive suite of lifecycle management features. From discovery and inventory to issuance, deployment, renewal, revocation, and reporting, CertSecure provides an all-encompassing solution. Intelligent report generation, alerting, automation, automatic deployment onto servers, and certificate enrollment add layers of sophistication, making it a versatile and intelligent asset. For complete cryptographic visibility across all PKI environments including cloud-native and hybrid CA sources, CBOM Secure builds the cryptographic bill of materials that complements certutil and certreq command-line diagnostics with a continuous, automated inventory layer.

Conclusion

Certutil and certreq are powerful tools for managing certificates in Windows environments. Even though their fundamental functions are widely recognized, delving into their sophisticated features and hidden switches reveals a wealth of advanced capabilities.

These tools offer a level of visibility and control over certificate management that goes well beyond what the MMC console provides. Server administrators who invest time in understanding certutil and certreq’s full capabilities, particularly the hidden switches exposed through -uSAGE, will find themselves diagnosing and resolving PKI issues significantly faster. If managing and securing your certificate infrastructure requires deeper expertise, Encryption Consulting’s PKI team is here to help.

Frequently Asked Questions

Every Layer of Cryptography.
One Team to Secure It.

See how Encryption Consulting secures what your enterprise depends on, from assessment through deployment.

Request a Demo