Skip to content

Comments

Refactor PGP verification to use inheritance-based architecture#16495

Draft
Copilot wants to merge 7 commits intomainfrom
copilot/add-detached-signature-validation
Draft

Refactor PGP verification to use inheritance-based architecture#16495
Copilot wants to merge 7 commits intomainfrom
copilot/add-detached-signature-validation

Conversation

Copy link
Contributor

Copilot AI commented Feb 2, 2026

Replaces PgpVerificationHelper static class with PgpVerifier abstract base class to provide cleaner inheritance hierarchy for PGP signature verification.

Architecture Changes

New PgpVerifier abstract base class (extends FileVerifier)

  • Encapsulates GPG verification workflow and timestamp extraction
  • Provides VerifyPgpSignature() as public static method for shared use
  • Defines abstract GetSignatureDocumentAndSignableContent() contract

SigVerifier inheritance

  • Now extends PgpVerifier instead of FileVerifier
  • Implements signature/content extraction for detached .sig files

LinuxPackageVerifier composition

  • Continues extending ArchiveVerifier (required for archive unpacking)
  • Calls PgpVerifier.VerifyPgpSignature() static method
  • Maintains compatibility with RpmVerifier and DebVerifier subclasses
FileVerifier
  ├── PgpVerifier (abstract)
  │   └── SigVerifier
  └── ArchiveVerifier
      └── LinuxPackageVerifier
          ├── RpmVerifier
          └── DebVerifier

Works around C# single inheritance limitation by providing static method for classes that cannot inherit from PgpVerifier.

To double check:

Original prompt

This section details on the original issue you should resolve

<issue_title>SignCheck should validate detached signatures</issue_title>
<issue_description>Support for signing tars and zips with detached signatures was added into SignTool: #16035. We should add verification for these detached signatures in SignCheck. SignCheck would need a way to accept additional signature info for these signed artifacts (signature file, public key)</issue_description>

<agent_instructions>Allow SignCheck to validate detached PGP signatures by introducing first-class support for .sig assets.

  • Add a new file verifier type for .sig files.
  • Refactor the existing Linux package verification into a generic PGP verifier base (since detached signatures should be PGP-verified), and have the new .sig verifier inherit from / reuse that PGP verification implementation.
  • A detached signature must always have the same name as the signed file, with an added .sig extension (e.g., foo.tar.gzfoo.tar.gz.sig).</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 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.

Copilot AI and others added 5 commits February 2, 2026 19:06
Co-authored-by: ellahathaway <67609881+ellahathaway@users.noreply.github.com>
Co-authored-by: ellahathaway <67609881+ellahathaway@users.noreply.github.com>
Co-authored-by: ellahathaway <67609881+ellahathaway@users.noreply.github.com>
…andling

Co-authored-by: ellahathaway <67609881+ellahathaway@users.noreply.github.com>
Co-authored-by: ellahathaway <67609881+ellahathaway@users.noreply.github.com>
Copilot AI changed the title [WIP] Add validation for detached signatures in SignCheck Add detached PGP signature verification for .sig files Feb 2, 2026
Copilot AI requested a review from ellahathaway February 2, 2026 19:17
Copy link
Member

@ellahathaway ellahathaway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot - Instead of creating a helper class, please rename LinuxPackageVerifier to PgpVerifier, and update all references accordingly. Then have SigVerifier inherit from PgpVerifier.

Co-authored-by: ellahathaway <67609881+ellahathaway@users.noreply.github.com>
Copilot AI changed the title Add detached PGP signature verification for .sig files Refactor PGP verification to use inheritance-based architecture Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SignCheck should validate detached signatures

2 participants