Search results for

codesign

3,110 results found

Post

Replies

Boosts

Views

Activity

Disabling Hardened Runtime For Ad Hoc Signing Only
How can I disable Hardened Runtime in Xcode only when signing ad hoc? If I make a new project, Xcode will say Disabling hardened runtime with ad-hoc codesigning. at the beginning of the build logs. However, somehow my project isn't doing this -- it's still hardening the runtime when ad-hoc signing. What should I do to debug this?
5
0
108
May ’25
TKTokenSession not used
Hi, I'm working on developing my own CryptoTokenKit (CTK) extension to enable codesign with HSM-backed keys. Here's what I’ve done so far: The container app sets up the tokenConfiguration with TKTokenKeychainCertificate and TKTokenKeychainKey. The extension registers successfully and is visible via pluginkit when launching the container app. The virtual smartcard appears when running security list-smartcards. The certificate, key, and identity are all visible using security export-smartcard -i [card]. However, nothing appears in the Keychain. After adding logging and reviewing output in the Console, I’ve observed the following behavior when running codesign: My TKTokenSession is instantiated correctly, using my custom TKToken implementation — so far, so good. However, none of the following TKTokenSession methods are ever called: func tokenSession(_ session: TKTokenSession, beginAuthFor operation: TKTokenOperation, constraint: Any) throws -> TKTokenAuthOperation func tokenSession(_ session
3
0
84
Apr ’25
Issues Signing .app with Developer ID Certificate — Missing Private Key and Pipeline Concerns
I’m having issues trying to codesign a .app file. We generated the Developer ID Application certificate using the organization owner’s account. I downloaded the certificate to my Mac and imported it into my keychain, but when I run the codesign command below, I get the following error. Could you help me? What am I doing wrong? Is there any other way to sign the .app executable? From what I’ve seen in other posts, it looks like the certificate needs to have a private key, but the certificate I download from the developer portal doesn’t include the key. Also, about exporting it as a .p12 — I couldn’t quite understand if that’s considered a safe practice, since the organization owner’s private key would be included in this certificate that we plan to use in our pipeline.
1
0
99
May ’25
CodeSign : errSecInternalComponent
I’ve been wrestling with this for nearly a week now and none of the proposed fixes have worked. I’m trying to resign an app via Jenkins and have done the following: Created a custom keychain Imported the required .p12 certificates Installed the Apple WWDR certificate in the System keychain Made the login keychain my default Added my development keychain, the login keychain and the System keychain to the user keychain list Unlocked my development keychain Confirmed my signing identity is present Granted the appropriate partition list access to the keychain security set-key-partition-list -S apple-tool:,codesign: -k pwd /Users/ec2-user/Library/Keychains/development.keychain-db Yet when I invoke Fastlane’s resign action, I still see: _floatsignTemp/Payload/EverMerge.app/Frameworks/AppLovinSDK.framework: replacing existing signature _floatsignTemp/Payload/EverMerge.app/Frameworks/AppLovinSDK.framework: errSecInternalComponent Encountered an error, aborting! Any guidance on what might be causing this errS
1
0
112
May ’25
Reply to productbuild hangs with no output in github actions
also can confirm that I can take my bosses p12 files and set them up on my computer using this script KEYCHAIN_PATH1=$HOME/Library/Keychains/tmpsed1.keychain-db KEYCHAIN_PASSWORD1=$(openssl rand -base64 12) security create-keychain -p $KEYCHAIN_PASSWORD1 $KEYCHAIN_PATH1 security unlock-keychain -p $KEYCHAIN_PASSWORD1 $KEYCHAIN_PATH1 echo keychain-path=$KEYCHAIN_PATH1 echo keychain-password=$KEYCHAIN_PASSWORD1 #DEV_ID_APPLICATION=$(mktemp) #echo $DEV_ID_APPLICATION #base64 -i app.p12 | base64 -d >$DEV_ID_APPLICATION #cat $DEV_ID_APPLICATION security import app.p12 -f pkcs12 -k $KEYCHAIN_PATH1 -P password -T /usr/bin/codesign -T /usr/bin/security export DEV_ID_INSTALLER=$(mktemp) base64 -i installer.p12 | base64 -d >$DEV_ID_INSTALLER security import installer.p12 -f pkcs12 -k $HOME/Library/Keychains/tmpsed1.keychain-db -P “password” -T /usr/bin/pkgbuild -T /usr/bin/security -T /usr/bin/productbuild rm $DEV_ID_INSTALLER security set-key-partition-list -S apple-tool:,apple: -s -k $KEYCHAIN_PATH1 $K
May ’25
CodeSign with out Certificate and Profile
We are facing issue with resigning the app which is developed by 3rd party. In this app we have Sharing functionality feature for which we have enabled Associated Domains capability. When we are signing the app with our certificate and profile this functionality is not working i.e when we are clicking on shared link in the app it is redirecting to app store page instead of content link. However, when 3rd party is directly using our certificate & profile then that functionality is working as expected. Could you please help us with the above issue why it is not working when we are resigning with our certificate and profile?
2
0
137
May ’25
Reply to Gatekeeper "bundle_id: NOT_A_BUNDLE" rejection
[quote='837189022, LinuxProg, /thread/782331?answerId=837189022#837189022, /profile/LinuxProg'] It would be very useful for Apple to add a test VM creation CLI to the developer toolkit [/quote] I tend to agree but, given that current reality, I encourage you to explore the raft of third-party options out there [1]. As to your original issue, adding an extension is the right option here. macOS draws a clear distinction between bundled and non-bundle code. This really matters when comes to code signing. See the discussion is Creating distribution-signed code for macOS. That Java runtime is signed as a bundle: % codesign -d -vvv jdk-21.0.7+6-jre Executable=/Users/quinn/Desktop/jdk-21.0.7+6-jre/Contents/MacOS/libjli.dylib Identifier=net.java.openjdk.jre Format=bundle with Mach-O thin (arm64) ^^^^^^ However, the exact definition of what constitutes a bundle is more squishy then it should be. It seems that codesign and Gatekeeper disagree as to whether the file name extension is required, which is
Topic: Code Signing SubTopic: Notarization Tags:
Apr ’25
Gatekeeper "bundle_id: NOT_A_BUNDLE" rejection
Context: large platform-agnostic CLI tool built as a handcrafted bundle (not via an Xcode project) that has been successfully codesigned, stapled, and zipped; macOS 14.7.5 syspolicy_check reports App passed all pre-distribution checks and is ready for distribution. However, running the executable in the Terminal produces a cannot be opened because the developer cannot be verified popup. The executable does succeed after manually clearing its quarantine attribute. Having worked through Resolving Gatekeeper Problems, the only detail logged in the Console is Adding Gatekeeper denial breadcrumb (direct): ... bundle_id: NOT_A_BUNDLE. Experimental observations: a minimized trivial CLI executable with a similar bundle layout and name successfully executes without being rejected, and oddly, renaming the original bundle from name to name.suffix allows it to be successfully executed. It's unclear why the bundle name would affect Gatekeeper only in some circumstances, and we'd greatly prefer not to rename the b
3
0
130
Apr ’25
Reply to macOS 11.x system reported an error when using endpoint security
Yeah, this stuff is complex )-: Let me clarify this by example. My go-to suggestion for setting this up is to do what Xcode does. In fact, we have that in the official documentation, namely Signing a daemon with a restricted entitlement. If you follow that process and build the test project with Xcode, you see this: % codesign -d --entitlements - Test782415.app … [Dict] [Key] com.apple.application-identifier [Value] [String] SKMME9E2Y8.com.example.apple-samplecode.Test782415 [Key] com.apple.developer.endpoint-security.client [Value] [Bool] true [Key] com.apple.developer.team-identifier [Value] [String] SKMME9E2Y8 [Key] com.apple.security.get-task-allow [Value] [Bool] true % security cms -D -i Test782415.app/Contents/embedded.provisionprofile | plutil -p - { … Entitlements => { com.apple.application-identifier => SKMME9E2Y8.com.example.apple-samplecode.Test782415 com.apple.developer.endpoint-security.client => 1 com.apple.developer.team-identifier => SKMME9E2Y8 keychain-access-groups =>
Topic: Code Signing SubTopic: Entitlements Tags:
Apr ’25
macOS 11.x system reported an error when using endpoint security
This is .entitlements file: com.apple.developer.endpoint-security.client Code signing: codesign --sign -vvv --timestamp --options=runtime --force --entitlements ./UES.entitlements -s Developer ID Application: XXXX Ltd. (XXXXXX) ./UES.app When I run it on macOS 13.x, it works fine. If I run the system on macOS 11.x, it reports a killed error (if codesign remove --entitlements ./UES.entitlements, Then the startup will not report an error, but the endpoint security rights cannot be used) System log: 2025-04-21 13:58:27.039638+0800 0xd5941 Default 0x0 149 0 amfid: /Applications/UES.app/Contents/MacOS/UES signature not valid: -67050 2025-04-21 13:58:27.039762+0800 0xd5bbf Default 0x0 0 0 kernel: mac_vnode_check_signature: /Applications/UES.app/Contents/MacOS/UES: code signature validation failed fatally: When validating /Applications/UES.app/Contents/MacOS/UES: 2025-04-21 13:58:27.039815+0800 0xd5bbf Default 0x0 0 0 kernel: proc 29354: load code signature error 4 for file UES 2025-04-21 13
3
0
129
Apr ’25
Reply to notarization - not a valid developer certificate
Thank you. I see, so I was using the wrong type of certificate and that's why notarization was failing. Thank you for your help so far. With the correct cert, I have hit another blocker: I sent off the certificate signing request and downloaded the correct certificate and imported it into keychain access. It has the name: Developer ID Application: COMPANY REDACTED (REDACTED ID) Green check mark: This certificate is valid. I see other information like the issuer: Developer ID Certification Authority Apple Certification Authority This matches what you mentioned above. Just making sure. And, I have removed the old certificate from keychain access and disk so it won't interfere. I mention this because of the below blocker. To my knowledge, this does not look like a self signed cert. Which... would be weird as I downloaded it from the certificate signing request. When I go to code sign now: codesign -s REDACTED ID SAME AS DEVELOPER ID APPLICATION CERT -f --timestamp -o runtime -i com.redacted.hello_world
Apr ’25
notarization - not a valid developer certificate
I have a binary which I have signed with a valid developer certificate. Here is how I verify the signature was correctly applied: % codesign -dvv ./test_program.exe Executable=/Users/REDACTED/code_signing/test_program.exe Identifier=com.REDACTED.hello_world Format=Mach-O thin (arm64) CodeDirectory v=20500 size=489 flags=0x10000(runtime) hashes=9+2 location=embedded Signature size=9071 Authority=Mac Developer: REDACTED NAME (REDACTED_ID) Authority=Apple Worldwide Developer Relations Certification Authority Authority=Apple Root CA Timestamp=Apr 16, 2025 at 11:26:43 AM Info.plist=not bound TeamIdentifier=REDACTED Runtime Version=14.2.0 Sealed Resources=none Internal requirements count=1 size=192 ============================== Additionally, I have confirmed in keychain access that my certificate is valid. Here is the output from the GUI: Issued by: Apple Worldwide Developer Relations Certification Authority Expires: Wednesday, April 15, 2026 at 3:50:14 PM Eastern Daylight Time This certificate is valid =
2
0
97
Apr ’25
macOS 11.x system reported an error when using endpoint security
This is my .entitlements file: Code signing: codesign --sign -vvv --timestamp --options=runtime --force --entitlements ./UES.entitlements -s Developer ID Application: XXX. (XXXXXXX) ./UES.app I work fine in the macOS 13.x system, but the killed error occurs in macOS11.x. The system log is displayed as follows: (If codesign remove the --entitlements ./UES.entitlements, it will operate normally) 2025-04-21 13:58:27.039638+0800 0xd5941 Default 0x0 149 0 amfid: /Applications/UES.app/Contents/MacOS/UES signature not valid: -67050 2025-04-21 13:58:27.039762+0800 0xd5bbf Default 0x0 0 0 kernel: mac_vnode_check_signature: /Applications/UES.app/Contents/MacOS/UES: code signature validation failed fatally: When validating /Applications/UES.app/Contents/MacOS/UES: 2025-04-21 13:58:27.039815+0800 0xd5bbf Default 0x0 0 0 kernel: proc 29354: load code signature error 4 for file UES 2025-04-21 13:58:27.040720+0800 0xd5bc0 Default 0x0 0 0 kernel: (AppleSystemPolicy) ASP: Security policy would not allow proc
1
0
58
Apr ’25
macOS 11.x system reported an error when using endpoint security
This is .entitlements file: com.apple.developer.endpoint-security.client Code signing: codesign --sign -vvv --timestamp --options=runtime --force --entitlements ./UES.entitlements -s Developer ID Application: XXXX Ltd. (XXXXXX) ./UES.app When I run it on macOS 13.x, it works fine. If I run the system on macOS 11.x, it reports a killed error (if codesign remove --entitlements ./UES.entitlements, Then the startup will not report an error, but the endpoint security rights cannot be used) System log: 2025-04-21 13:58:27.039638+0800 0xd5941 Default 0x0 149 0 amfid: /Applications/UES.app/Contents/MacOS/UES signature not valid: -67050 2025-04-21 13:58:27.039762+0800 0xd5bbf Default 0x0 0 0 kernel: mac_vnode_check_signature: /Applications/UES.app/Contents/MacOS/UES: code signature validation failed fatally: When validating /Applications/UES.app/Contents/MacOS/UES: 2025-04-21 13:58:27.039815+0800 0xd5bbf Default 0x0 0 0 kernel: proc 29354: load code signature error 4 for file UES 2025-04-21 13
1
0
41
Apr ’25
add /usr/bin/codesign to acl for private key
Displaying attribute for a private key I see a number of applications that are allowed to access it without needing a password e.g. racoon; Keychain Access.app; Certificate Assitant.app etc.. I want to add /usr/bin/codesign to the list but the gui window that pops up when I click on + doesn't seem to allow me to do that :( How do I do it please
Topic: Code Signing SubTopic: General
3
0
50
Apr ’25