Skip to content

Commit f2c82f0

Browse files
roger-cruzmairaw
authored andcommitted
Add -KeyUsage that includes CertSign and change OIDs to use Extended … (#10302)
1 parent ec37d64 commit f2c82f0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/framework/wcf/feature-details/how-to-create-temporary-certificates-for-use-during-development.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ When developing a secure service or client using Windows Communication Foundatio
2222
The following command creates a self-signed certificate with a subject name of "RootCA" in the Current User Personal store.
2323

2424
```powershell
25-
$rootCert = New-SelfSignedCertificate -CertStoreLocation cert:\CurrentUser\My -DnsName "RootCA" -TextExtension @("2.5.29.37={text}1.3.6.1.5.5.7.3.1,1.3.6.1.5.5.7.3.2") -KeyUsage CertSign,DigitalSignature
25+
$rootcert = New-SelfSignedCertificate -CertStoreLocation Cert:\CurrentUser\My -DnsName "RootCA" -TextExtension @("2.5.29.19={text}CA=true") -KeyUsage CertSign,CrlSign,DigitalSignature
2626
```
2727

2828
We need to export the certificate to a PFX file so that it can be imported to where it's needed in a later step. When exporting a certificate with the private key, a password is needed to protect it. We save the password in a `SecureString` and use the [Export-PfxCertificate](/powershell/module/pkiclient/export-pfxcertificate) cmdlet to export the certificate with the associated private key to a PFX file. We also save just the public certificate into a CRT file using the [Export-Certificate](/powershell/module/pkiclient/export-certificate) cmdlet.

0 commit comments

Comments
 (0)