Skip to content

New example for New-SelfSignedCertificate, clarifies the KeyUsage parameter #3605

Open
@ehmiiz

Description

@ehmiiz

Prerequisites

  • Existing Issue: Search the existing issues for this repository. If there is an issue that fits your needs do not file a new one. Subscribe, react, or comment on that issue instead.
  • Descriptive Title: Write the title for this issue as a short synopsis. If possible, provide context. For example, "Typo in Get-Foo cmdlet" instead of "Typo."
  • Verify Version: If there is a mismatch between documentation and the behavior on your system, ensure that the version you are using is the same as the documentation. Check this box if they match or the issue you are reporting is not version specific.

Links

Summary

To address the issue PowerShell/PowerShell#20119
It is not clear by the examples how to provide multiple values in the KeyUsage parameter of New-SelfSignedCertificate
This issue asks to add an additional example to the documentation that gives a KeyUsage array rather than a single KeyUsage entry

Details

Will provide a pull request. See details in Suggested Fix.

Suggested Fix

To add an example that looks similar to this:

Example 10

$params = @{
    Type = 'Custom'
    Subject = 'CN=Patti Fuller,OU=UserAccounts,DC=corp,DC=contoso,DC=com'
    TextExtension = @(
        '2.5.29.37={text}1.3.6.1.5.5.7.3.2',
        '2.5.29.17={text}upn=pattifuller@contoso.com' )
    KeyUsage = 'DigitalSignature', 'CRLSign', 'CertSign'
    KeyAlgorithm = 'RSA'
    KeyLength = 2048
    CertStoreLocation = 'Cert:\CurrentUser\My'
}
New-SelfSignedCertificate @params

This example creates a self-signed client authentication certificate in the user MY store. The certificate uses the default provider, which is the Microsoft Software Key Storage Provider. The certificate uses an RSA asymmetric key with a key size of 2048 bits. The certificate has a subject alternative name of pattifuller@contoso.com. The certificate has it's key usages set to DigitalSignature, CRLSign and CertSign.

The certificate expires in one year.

Metadata

Metadata

Assignees

Labels

issue-doc-bugSomething is out of date, unclear, confusing, or broken in the article. Blocks customer success.needs-triageWaiting - Needs triage

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions