Add SubjectAlternativeName property to Get-AuthenticodeSignature#26252
Add SubjectAlternativeName property to Get-AuthenticodeSignature#26252daxian-dbw merged 23 commits intomasterPowerShell/PowerShell:masterfrom copilot/add-subjectalternative-namePowerShell/PowerShell:copilot/add-subjectalternative-nameCopy head branch name to clipboard
Conversation
…ld documentation Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
…/linux.md Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
This PR adds a SubjectAlternativeName property to the Signature class returned by Get-AuthenticodeSignature, enabling users to access SAN extension data from signer certificates directly through the cmdlet output.
- Adds nullable
SubjectAlternativeNameproperty to theSignatureclass with extraction logic for OID 2.5.29.17 - Implements helper method to search certificate extensions and format SAN data
- Adds comprehensive test coverage for certificates with and without SAN extensions using CurrentUser certificate stores
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/System.Management.Automation/security/MshSignature.cs | Adds SubjectAlternativeName property and extraction logic to Signature class |
| test/powershell/engine/Security/FileSignature.Tests.ps1 | Adds tests verifying SAN property existence and content for certificates with/without SAN extensions |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: iSazonov <22290914+iSazonov@users.noreply.github.com>
Co-authored-by: iSazonov <22290914+iSazonov@users.noreply.github.com>
…erator Co-authored-by: iSazonov <22290914+iSazonov@users.noreply.github.com>
Co-authored-by: iSazonov <22290914+iSazonov@users.noreply.github.com>
|
@copilot Open an issue in the repo https://github.com/MicrosoftDocs/PowerShell-Docs to track the documentation of the new propery
|
|
|
Doc issue opened for the new property: MicrosoftDocs/PowerShell-Docs#12745 |
,$result | Should -BeOfType [string[]]Should -BeExactlyfor precise array element validation at specific indicesSummary
This PR adds a
SubjectAlternativeNameproperty to theSignatureclass returned byGet-AuthenticodeSignature. The implementation:string[]property that extracts the SAN extension (OID 2.5.29.17) from the signer certificateGetSubjectAlternativeName()that searches for and formats the SAN extension using a named constant, then splits it into individual array elements (one per line) using all common line separators for cross-platform compatibility. Handles null certificates gracefully.Should -BeExactlyfor precise validation of array element values at specific indicesThe implementation follows the C# translation of the PowerShell example code provided in the issue and maintains backward compatibility.
Original prompt
Fixes #14006
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.