Open openradar-mirror opened 5 years ago
I've had the very same problem. It turned out that the private key of the certificate was not available in the System keychain, but only in my login keychain. After I moved it to the System keychain, it worked again.
For security cms -S
to work properly, both the certificate and its private key must be available in the System keychain!
Description
When using
/usr/bin/security cms -S
command to sign profiles, the resulting signed profile is signed by another (seemingly) random certificate from my login keychain.Steps to Reproduce:
/usr/bin/security find-identity -p codesigning
/usr/bin/security find-identity -p codesigning -v | awk -F\" '/Developer ID/ {print $2}'
/usr/bin/security cms -S -G -H SHA256 -N 'Developer ID Application: ROCHESTER INSTITUTE OF TECHNOLOGY (INC) (77JG5V6MM7)' -i '/Users/n8felton/edu.rit.certificates.root.mobileconfig' -o '/Users/n8felton/edu.rit.certificates.root.mobileconfig'
Expected Results:
openssl pkcs7 -inform DER -print_certs -in '/Users/n8felton/edu.rit.certificates.root.mobileconfig'