Certutil tasks for managing certificates (original) (raw)

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2

Certutil tasks for managing certificates

You can use certutil to perform a number of certificate management tasks.

To view the syntax for a specific task, click a task:

To validate that the certificate was issued by a specific CA

To verify the validity of a certificate

To install the CA certificate

To request a renewal CA certificate

To delete keys from the HKEY_LOCAL_MACHINE root store

To add Netscape-compatible Web-based revocation check extensions to every issued certificate

To retrieve the CA signing certificate and save it to a file

To retrieve the CA signing certificate and chain and save it to a PKCS #7 file

To import a certificate into the server database

To display the certificates in the Local Machine certificate store

To add a certificate or CRL to a local trusted root CA store

To view certificate stores

To verify all certificates in a store

To delete a certificate from the HKEY_LOCAL_MACHINE root store

To delete a certificate from the HKEY_CURRENT_USER root store

To validate that the certificate was issued by a specific CA

Syntax

certutil -verify [-f] [-enterprise] [-user] [-gmt] [-seconds] [-silent] [-split] [-v] CertFile [_CACertFile_]

Parameters

To verify the validity of a certificate

Syntax

certutil -isvalid [-gmt] [-seconds] [-v] [-config CAMachineName**\**_CAName_] {SerialNumber | CertHash}

Parameters

To install the CA certificate

Syntax

certutil -installcert [-f] [-gmt] [-seconds] [-v] [-config CAMachineName**\**_CAName_] [_CACertFile_]

Parameters

To request a renewal CA certificate

Syntax

certutil -renewcert [-f] [-gmt] [-seconds] [-v] [-config CAMachineName**\**_CAName_] [reusekeys] RequestFile

Parameters

To delete keys from the HKEY_LOCAL_MACHINE root store

Syntax

certutil -delkey [-user] [-gmt] [-seconds] [-silent] [-v] KeyContainerName [_CSPName_]

Parameters

Caution

To add Netscape-compatible Web-based revocation check extensions to every issued certificate

Syntax

certutil -setreg [-user] [-gmt] [-seconds] [-v] Policy\RevocationType {+ | -} REVEXT_ASPENABLE

Parameters

Caution

Note

To retrieve the CA signing certificate and save it to a file

Syntax

certutil -ca.cert [-f] [-gmt] [-seconds] [-split] [-v] [-config CAMachineName**\**_CAName_] OutCACertFile [_Index_]

Parameters

To retrieve the CA signing certificate and chain and save it to a PKCS #7 file

Syntax

certutil -ca.chain [-f] [-gmt] [-seconds] [-split] [-v] [-config CAMachineName**\**_CAName_] OutCACertChainFile [_Index_]

Parameters

To import a certificate into the server database

Syntax

certutil -importcert [-f] [-gmt] [-seconds] [-v] [-config CAMachineName**\**_CAName_] CertFile

Parameters

To display the certificates in the Local Machine certificate store

Syntax

certutil -store [-f] [-enterprise] [-user] [-gmt] [-seconds] [-silent] [-v] [-dc _DCName_] CertificateStoreName [CertID [_OutFile_]]]

Parameters
<table>
<colgroup>
<col style="width: 50%" />
<col style="width: 50%" />
</colgroup>
<thead>
<tr class="header">
<th>Value</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><p><strong>ca</strong></p></td>
<td><p>Specifies certificates in the Intermediate Certification Authorities store.</p></td>
</tr>
<tr class="even">
<td><p><strong>my</strong></p></td>
<td><p>Specifies certificates issued to the current user.</p></td>
</tr>
<tr class="odd">
<td><p><strong>root</strong></p></td>
<td><p>Specifies certificates in the Trusted Root Certification Authorities store.</p></td>
</tr>
<tr class="even">
<td><p><strong>spc</strong></p></td>
<td><p>Specifies software publisher certificates.</p></td>
</tr>
<tr class="odd">
<td><p><em>UserCreatedStore</em></p></td>
<td><p>Specifies the name of a user-created certificate store.</p></td>
</tr>
</tbody>
</table>
Examples

To view the certificates in the NTAuth store of the local computer, type:

certutil -store -enterprise NTAuth

To view the certificates in the "Root" store of the local computer with cert Index as 37, type:

certutil -store -enterprise Root 37

To view the certificate of the user that has the serial number 26e0aaaf000000000004 in the store named My, type:

certutil -store -user My 26e0aaaf000000000004

To view the CRL with index .11 in the store named CA, type:

certutil -store CA .11

To view the certificates store at Lightweight Directory Access Protocol (LDAP) location "ldap:///CN=NTAuthCertificates,CN=Public Key Services,CN=Services,DC=corp,DC=MyCorp,DC=com", type:

certutil -store ldap:///CN=NTAuthCertificates,CN=Public Key Services,CN=Services,DC=corp,DC=MyCorp,DC=com

To add a certificate or CRL to a local trusted root CA store

Syntax

certutil -addstore [-f] [-enterprise] [-user] [-gmt] [-seconds] [-v] [-dc _DCName_] root InFile

Parameters

To view certificate stores

Syntax

Certutil [{-viewstore | -viewdelstore}] [-f] [-enterprise] [-user] [-gmt] [-seconds] [-v] [-dc _DCName_] {my | ca | root | spc} ["CertIndex" ]

Parameters
Examples

To open and view the local NTAuth store on the current computer, type:

certutil -viewstore -enterprise NTAuth

To delete a certificate, type:

certutil -delstore -enterprise NTAuth " CertIndex "

To verify all certificates in a store

Syntax

certutil -verifystore [-enterprise] [-user] [-gmt] [-seconds] [-split] [-v] [-dc _DCName_] CertificateStoreName [_CertID_]

Parameters

To delete a certificate from the HKEY_LOCAL_MACHINE root store

Syntax

certutil -delstore [-enterprise] [-user] [-gmt] [-seconds] [-v] [-dc _DCName_] root CertIndex

Parameters

To delete a certificate from the HKEY_CURRENT_USER root store

Syntax

certutil -delstore [-enterprise] [-user] [-gmt] [-seconds] [-v] [-dc _DCName_] root -user CertIndex

Parameters

If it was not previously backed up or archived, the deleted key will be irretreivable.

If the deleted key was used for a certificate server signing key, the CA will be disabled and will not be able to issue new CRLs, which will effectively invalidate all of the certificates issued by the CA when the existing CRLs expire. You can replace other signing keys by re-enrolling for a new key and certificate.

If the deleted key was used for encrypting e-mail, previously received e-mail might be unreadable, unless you can recover it from a key management system like Key Management Service (KMS).

If the deleted key was used for encrypting files, an administrator with the appropriate credentials to create a Key Recovery Agent account might need to intervene and decrypt each file individually for the affected user.

Use - user to delete keys from the HKEY_CURRENT_USER root store.

Examples

To delete the fifth certificate in the root store, type:

certutil -delstore root 5

Formatting legend

Format Meaning
Italic Information that the user must supply
Bold Elements that the user must type exactly as shown
Ellipsis (...) Parameter that can be repeated several times in a command line
Between brackets ([]) Optional items
Between braces ({}); choices separated by pipe (|). Example: {even odd}
Courier font Code or program output

See Also

Concepts

Command-line reference A-Z
Command shell overview