Skip to content

Support for "Apple Development" and "Apple Distribution" certificates#5238

Open
yannickpulver wants to merge 15 commits intoJetBrains:masterfrom
yannickpulver:master
Open

Support for "Apple Development" and "Apple Distribution" certificates#5238
yannickpulver wants to merge 15 commits intoJetBrains:masterfrom
yannickpulver:master

Conversation

@yannickpulver
Copy link
Copy Markdown

@yannickpulver yannickpulver commented Feb 15, 2025

Fixes CMP-4272 macOS signing failing with modern Apple certificates and bare signing identities.

What changed

  • Supports all real Apple certificate common names for macOS signing:
    • Developer ID Application / Developer ID Installer (outside-App-Store distribution)
    • Apple Distribution (App Store distribution, current)
    • Apple Development (development, current)
    • 3rd Party Mac Developer Application / 3rd Party Mac Developer Installer (App Store, legacy)
    • Mac Developer (development, legacy)
  • Resolves bare signing identities (e.g. "John Doe") against all app-signing certificate types in the keychain instead of assuming only Developer ID Application
  • Fails with a clear error when multiple matching certificates are found
  • Always uses productsign for PKG signing instead of relying on jpackage --mac-sign, which fails with pre-signed app images
  • Fails early for invalid PKG signing combinations such as development certificates
  • Compatible with Fastlane match, which provisions Apple Distribution and 3rd Party Mac Developer Installer certificates — previously the plugin only recognized Developer ID Application and 3rd Party Mac Developer Application and was therefore not finding the right certs.

Certificate naming clarification

Apple's Developer portal UI labels don't always match the actual certificate common names (CN) stored in the keychain. This PR only includes certificate types whose CN prefix has been verified against real keychains:

Portal UI label Actual keychain CN
Mac App Distribution 3rd Party Mac Developer Application
Mac Installer Distribution 3rd Party Mac Developer Installer
Mac Development Mac Developer
Apple Distribution Apple Distribution
Apple Development Apple Development

Testing

  • 9 unit tests covering certificate resolution, installer candidate mapping, error cases
  • Verified createDistributable with:
    • Apple Development
    • Mac Developer
  • Verified packageReleaseDmg with:
    • Developer ID Application — signed via jpackage
  • Verified packageReleasePkg with:
    • Apple Distributionproductsign with 3rd Party Mac Developer Installer
    • 3rd Party Mac Developer Applicationproductsign with 3rd Party Mac Developer Installer
  • Verified packageReleasePkg fails with clear error for:
    • Apple Development (dev certs can't sign PKGs)
    • Developer ID Application without matching Developer ID Installer cert
  • All signatures verified with codesign -dvvv and pkgutil --check-signature
  • Verified end-to-end via Fastlane macos buildPkg lane with Apple Distribution identity
  • Verified against a real Compose app in Gridline:
  • Public sample project:

Release Notes

Fixes - Desktop

  • Improves macOS certificate support: resolves bare signing identities against all certificate types, always uses productsign for reliable PKG signing, and supports modern Apple certificate names including those provisioned by Fastlane match

@yannickpulver yannickpulver changed the title Updates fullDeveloperID Support for "Apple Development" and "Apple Distribution" certificates Feb 16, 2025
@kropp
Copy link
Copy Markdown
Member

kropp commented Mar 27, 2026

Hi @yannickpulver,
do you plan to continue working on this PR?

@yannickpulver
Copy link
Copy Markdown
Author

Hi @kropp I tried last year but failed to validate it. I could try to give it another go, but if there's somebody internally working on that I'm happy to close it.

yannickpulver and others added 6 commits March 27, 2026 13:59
…nd Mac Development certificates for macOS signing

jpackage only recognizes "Developer ID Application" and "3rd Party Mac Developer Application"
certificate prefixes — it prepends these to the identity, breaking newer Apple certificate types.
Skip jpackage signing for unsupported cert types and let the existing MacSigner handle it.
Also fixes passing raw identity instead of fullDeveloperID to jpackage.

Fixes CMP-4272, relates to CMP-7651
jpackage only signs PKGs with "Developer ID Installer" and "3rd Party Mac
Developer Installer" prefixes. For newer certificate types (Apple Distribution,
Mac App Distribution), sign the PKG post-creation using productsign.

Tries both "3rd Party Mac Developer Installer" and "Mac Installer Distribution"
as candidates since Apple still issues certs with the legacy name despite
documenting the new one.
@yannickpulver yannickpulver marked this pull request as ready for review March 30, 2026 21:00
- Remove unused isDevelopmentCertificate enum param
- Remove unsupported Mac Developer certificate kind
- Deduplicate certificate alias extraction between MacSigner and AbstractJPackageTask
- Simplify PKG signing to single-attempt instead of retry loop
- Inline isExplicitlyPrefixed property
Replace MacSigningIdentityInput with minimal ParsedSigningIdentity,
move installer cert mapping onto the enum, derive appSigningKinds
from entries instead of maintaining a manual list.
…panion

Consolidate identity parsing into the enum. Data classes become pure
data with no companions or factory methods.
Use matches.distinct() instead of linkedSetOf workaround. Convert
matchesCandidateIdentity from String extension to plain function.
Replace narrow IllegalStateException catch with finally block that
restores the unsigned PKG when signing fails for any reason.
…for PKG

Remove MacAppDistribution, MacDevelopment, MacInstallerDistribution — Apple
portal labels that don't match actual certificate common names. Add MacDeveloper
(real CN for "Mac Development" portal cert).

Always use productsign for PKG signing instead of jpackage --mac-sign, which
fails with pre-signed app images. This fixes PKG signing for all cert types.
@yannickpulver
Copy link
Copy Markdown
Author

Hi @kropp this should now be ready for review. Tested it in multiple projects and seems to work in the desired way.

@kropp kropp self-requested a review April 17, 2026 16:05
@kropp
Copy link
Copy Markdown
Member

kropp commented Apr 17, 2026

@yannickpulver thanks, I'll take a look next week

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.

2 participants