Hi all,
I'm using a CryptoTokenKit (CTK) extension to perform code signing without having the private key stored on my laptop. The extension currently only supports the rsaSignatureDigestPKCS1v15SHA256
algorithm:
func tokenSession(_ session: TKTokenSession, supports operation: TKTokenOperation, keyObjectID: TKToken.ObjectID, algorithm: TKTokenKeyAlgorithm) -> Bool {
return algorithm.isAlgorithm(SecKeyAlgorithm.rsaSignatureDigestPKCS1v15SHA256)
}
This setup works perfectly with codesign
, and signing completes without any issues.
However, when I try to use productsign
, the system correctly detects and delegates signing to my CTK extension, but it seems to always request rsaSignatureDigestPKCS1v15SHA1
instead:
productsign --timestamp --sign <identity> unsigned.pkg signed.pkg
productsign: using timestamp authority for signature
productsign: signing product with identity "Developer ID Installer: <org> (<team>)" from keychain (null)
...
Error Domain=NSOSStatusErrorDomain Code=-50
"algid:sign:RSA:digest-PKCS1v15:SHA1: algorithm not supported by the key"
...
productsign: error: Failed to sign the product.
From what I understand, older versions of macOS used SHA1 for code signing, but codesign
has since moved to SHA256 (at least when legacy compatibility isn't a concern). Oddly, productsign
still seems to default to SHA1, even in 2025.
Is there a known way to force productsign
to use SHA256 instead of SHA1 for the signature digest algorithm? Or is there some flag or configuration I'm missing?
Thanks in advance!
I had a chat with our installer folks about this and our current understanding is that there’s no way to sign an installer package without supporting SHA-1. So, if you want to sign installer packages, you’ll have to start doing this:
working with our provider to temporarily support SHA1
)-:
Which leads to this:
which they’ve deprecated for security reasons
That’s completely understandable, and we’re definitely open to improving this on our side. Please file a bug requesting that product{sign,build}
support SHA-256. Once you’re done, post your bug number and I’ll make sure the right folks see it.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"