Code Sigin
Certificate Required
To sign Electron apps, you may require two separate certificates:
The Developer ID Installer certificate is for apps distributed to the Mac App Store.
The Developer ID Application certificate is for apps distributed outside the Mac App Store.
Note:- Both these certificates can only be created by the Account Holder.
https://www.electronforge.io/guides/code-signing/code-signing-macos
How to Create Certificate on Apple Developer Account
Keychain Access on your Mac allows you to create a certificate signing request (CSR).
Create a certificate on the system:- https://developer.apple.com/help/account/create-certificates/create-a-certificate-signing-request
After this
Go to the Apple developer account
Go to the Certificates Click on the + icon, Here you will see Developer ID Application And Developer ID Installer if you logged in by owner account.
Select the certificate then click on continue.
Then choose the file that was created from the above link.
Once the certificate is created download it and double-click on the certificate. It will add the certificate to keyChain.
Sometimes you need to right-click on the certificate in key chain access and --> click on info --> make it Always trust
Code sign-in after build (dmg) may be for pkg
first, we will run a command that fixes error that we get if we create a build having a file which does not support for code-signing
export CSC_IDENTITY_AUTO_DISCOVERY=falseThen once dmg is created we run the command for its code-signing
codesign --force --sign "SID" "path_to_app_or_dmg" --deep
To get a valid identity, use
security find-identity -p codesigningThe above command return the identies which you can use at place of "SID".
Recommend to useDeveloper ID Application
Code sign-in file
//Open terminal at root of project
codesign -s "Developer ID Application: R...no Inc. (....)" <path to that file> //ex- src/file.node
codesign -dv <path to that file> //ex- src/file
// release is a folder name
codesign --remove-signatur Release/file
