Code signing is a security technology that you use to certify that an app was created by you.
On macOS the system can detect any change to the app, whether the change is introduced accidentally or by malicious code.
On Windows the system assigns a trust level to your code signing certificate which if you don't have, or if your trust level is low will cause security dialogs to appear when users start using your application. Trust level builds over time so it's better to start code signing as early as possible.
While it is possible to distribute unsigned apps, it is not recommended. For example, here's what macOS users see when attempting to start an unsigned app:
App can't be opened because it is from an unidentified developer
If you are building an Electron app that you intend to package and distribute, it should be code signed. The Mac and Windows app stores do not allow unsigned apps.
Before signing macOS builds, you must do the following:
There are a number of tools for signing your packaged app:
electron-osx-sign
is a standalone tool for signing macOS packages.electron-packager
bundles electron-osx-sign
. If you're using electron-packager
,
pass the --osx-sign=true
flag to sign your build.
electron-forge
uses electron-packager
internally, you can set the osxSign
option
in your forge config.electron-builder
has built-in code-signing capabilities. See electron.build/code-signingFor more info, see the Mac App Store Submission Guide.
Before signing Windows builds, you must do the following:
You can get a code signing certificate from a lot of resellers, popular ones include:
There are a number of tools for signing your packaged app:
electron-winstaller
will generate an installer for windows and sign it for youelectron-forge
can sign installers it generates through the Squirrel.Windows or MSI targets.electron-builder
can sign some of its windows targetsSee the Windows Store Guide.