productsign Command Appears to Succeed but Package has No Valid Signature
Category: Security, macOS, Code Signing
Question:
productsign command, when signing a PKG created with productbuild, appears to succeed with a success message (Wrote signed product archive to ...) but spctl verification results in rejected, source=no usable signature, indicating that the signature was not actually applied.
Details:
Goal: To sign a distribution package created with productbuild using a Developer ID Installer certificate.
Certificate Used:
Developer ID Installer: [Company Name] ([Team ID])
This certificate was issued by Previous Sub-CA and is not the latest G2 Sub-CA recommended by Apple. We cannot create a new G2 Sub-CA certificate as we have reached the limit of 5.
productsign Command:
productsign --sign "Developer ID Installer: [Company Name] ([Team ID])" [input.pkg] [output.pkg]
productsign Output:
Wrote signed product archive to [output.pkg] (Appears as a success message).
spctl Signature Verification:
spctl -a -vv [output.pkg]
Result: rejected, source=no usable signature
Notarization Service Results (Behavioral difference between Macs):
On Mac A, the submission status was Accepted.
On Mac B, the status was Invalid, with the notarization log message being The binary is not signed..
Troubleshooting Steps Taken:
We attempted to sign both component and distribution packages with productsign, and in both cases, the signature was not recognized by the system.
We skipped productsign and relied on the notarization service's auto-signing, but the notarization log still reported The binary is not signed., and the notarization failed.
We have confirmed that the certificate and private key are properly associated in Keychain Access.
My Questions:
Given that we are using an older Previous Sub-CA certificate and cannot create a new one, why does productsign appear to succeed when the signature is not being applied?
What could cause the behavioral difference where notarization is Accepted on Mac A but Invalid on Mac B?
Is this a known issue with Apple's tools, or is it possibly caused by the specific structure of our PKG?
What is the recommended workflow or debugging method to successfully sign and notarize a PKG under these circumstances?
Thank you for your assistance