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
  • Teach on BraveProgrammer

© 2026 BraveProgrammer. All rights reserved.

Code Signing – macOS | Electron.js Desktop App Development l | BraveProgrammer
  1. Courses
  2. /
  3. Electron.js Desktop App Development

Lesson 15 of 28

·javascript

Code Signing – macOS & Windows

9 mins

Course progress54%

What you'll learn

Keep these ideas in mind as you work through the lesson.

4 points
  • macOS: sign with **Developer ID**, then notarize via Apple’s notary service.
  • Windows: use `signtool` (or `osslsigncode` for open‑source certs).
  • The signature must be applied **before** the installer is built, or the installer must sign the contained binaries.
  • A missing or invalid signature will cause the app to be blocked or shown as untrusted.

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.

Make it stickPractice what you've learned1 quiz · 5 practical tests · Optional activities from Electron.js Desktop App DevelopmentBrowse activities
Previous lessonPackaging & Distribution – electron‑builderContinue to lesson 16Creating Installers – NSIS (Windows), DMG (macOS), AppImage (Linux)Back to Electron.js Desktop App Development curriculum