Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons

© 2026 BraveProgrammer. All rights reserved.

  1. Courses
  2. /
  3. Electron.js Desktop App Development

Lesson 15 of 28 · javascript

Code Signing – macOS & Windows

Duration: 9 mins

Code Signing – macOS & Windows

macOS notarization (Gatekeeper)

  1. Enroll in the Apple Developer Program.
  2. Export a Developer ID Application certificate.
  3. Sign the app bundle:
codesign --deep --force --options runtime --entitlements entitlements.plist \
  --sign "Developer ID Application: Your Name (TEAMID)" MyApp.app
  1. Notarize with xcrun altool (or notarytool in newer Xcode):
xcrun notarytool submit MyApp.app --apple-id YOUR_ID --password APP_SPECIFIC_PASSWORD --team-id TEAMID
  1. Once notarized, staple the ticket:
xcrun stapler staple MyApp.app

Windows code signing

  1. Purchase a code‑signing certificate (or use a free OpenSSL self‑signed cert for testing).
  2. Sign the executable with signtool:
signtool sign /f cert.pfx /p YOUR_PASSWORD /tr http://timestamp.digicert.com /td sha256 /fd sha256 dist/MyApp Setup.exe
  1. Verify:
signtool verify /pa /v dist/MyApp Setup.exe

Both platforms require the signature to be embedded before creating the installer; electron-builder can run the signing step automatically if you provide the appropriate config.

Previous: Packaging & Distribution – electron‑builderNext: Creating Installers – NSIS (Windows), DMG (macOS), AppImage (Linux)