0Pricing
Electron Desktop App Development · Урок

Подписание кода и нотариальная заверка

Разберитесь в важности подписания кода для Windows и нотариальной заверки для macOS, обеспечивающих доверие пользователей и соответствие требованиям безопасности.

«Подписание кода и нотариальная заверка» — бесплатный урок Electron Desktop App Development на CoddyKit. Это урок 2 из 4. Ты можешь прочитать весь урок бесплатно ниже — а потом практиковать его прямо в браузере с встроенным редактором кода и ИИ-репетитором 24/7. Это часть пути обучения Electron Desktop App Development, и твой прогресс синхронизируется между веб-версией и приложением CoddyKit. Курс Electron Desktop App Development содержит 4 уроков всего.

Части этого урока еще не переведены и отображаются на английском.

Building Trust with Code Signing

When you distribute your Electron app, users need to trust it. Operating systems like Windows and macOS have built-in security features to protect users from malicious software.

Code signing and notarization are essential steps to prove your app's authenticity and integrity, ensuring users feel safe installing it.

What is Code Signing?

Code signing is like attaching a digital signature to your application. It uses a cryptographic certificate issued by a trusted Certificate Authority (CA).

  • Authenticity: Verifies the app comes from you, the publisher.
  • Integrity: Confirms the app hasn't been tampered with since you signed it.

If the signature is invalid or altered, the OS will warn the user.

Trust on Windows

On Windows, unsigned applications often trigger security warnings like "Windows protected your PC" (SmartScreen filter).

A valid code signature helps your app pass these checks, giving users confidence and reducing installation friction. It also allows your app to be installed without extra administrator prompts for some operations.

Signing Windows Executables

To sign your Windows Electron app, you'll need a Code Signing Certificate. This is typically a PFX file containing your private key and certificate chain.

Tools like electron-builder simplify this process by letting you specify your certificate details in the configuration.

{
  "build": {
    "win": {
      "target": "nsis",
      "signingHashAlgorithms": ["sha256"],
      "signAndEditExecutable": true
    },
    "cscKeyPassword": "your-cert-password",
    "cscInstallerPassword": "your-cert-password",
    "cscLink": "path/to/your/certificate.pfx"
  }
}

Time-Stamping Your Signature

When code signing, it's crucial to also time-stamp your signature. This ensures that even if your signing certificate expires, the signature remains valid because it was signed when the certificate was active.

Most signing tools, including electron-builder, can automatically add a time-stamp server URL to your signing process.

macOS Notarization Explained

For macOS, Apple introduced Notarization as an additional security check. It's an automated service that scans your app for malicious content and code signature issues.

Think of it as Apple giving your app a "seal of approval" before it can run smoothly on macOS Catalina and later.

Meeting Apple's Gatekeeper

macOS's security feature, Gatekeeper, blocks unsigned or unnotarized apps from running by default. Users will see a warning that the app "cannot be opened because the developer cannot be verified."

Notarization allows your app to pass Gatekeeper checks without annoying users or requiring them to bypass security settings manually.

Getting Ready for Notarization

To notarize your Electron app, you need:

  • An Apple Developer ID.
  • An app-specific password for your Apple ID.
  • Your app must be signed with a Developer ID Application certificate.
  • Hardened Runtime enabled (a security feature).

electron-builder handles most of these configurations for you.

Notarizing with electron-builder

electron-builder simplifies the notarization process. You configure your Apple ID credentials and it handles uploading your app to Apple's notarization service.

It waits for the notarization to complete and then "staples" the notarization ticket to your app bundle.

{
  "build": {
    "mac": {
      "hardenedRuntime": true,
      "gatekeeperAssess": false,
      "entitlementsInherit": "build/entitlements.mac.plist",
      "entitlements": "build/entitlements.mac.plist"
    },
    "afterSign": "electron-builder-notarize"
  }
}

Secure & Automated Signing

Always keep your signing certificates and private keys secure. Treat them like sensitive passwords.

Integrate code signing and notarization into your Continuous Integration/Continuous Deployment (CI/CD) pipeline to automate the process and ensure every build is properly signed and notarized.

Check Your Knowledge

Which statements accurately describe the purpose or requirements of code signing and macOS notarization?

Recap: Trust & Security

In this lesson, we learned about the critical role of code signing for Windows and notarization for macOS in distributing your Electron applications.

These processes build user trust, ensure app integrity, and help your app run smoothly on target operating systems by satisfying their built-in security requirements.

Часто задаваемые вопросы

Урок «Подписание кода и нотариальная заверка» бесплатный?

Да — полный текст урока «Подписание кода и нотариальная заверка» бесплатно доступен здесь в веб-версии. Чтобы практиковать его интерактивно (встроенный редактор кода и ИИ-репетитор 24/7) и разблокировать остальной курс Electron Desktop App Development, подпишись на CoddyKit PRO. Курс Electron Desktop App Development содержит 4 уроков всего.

Чему я научусь в уроке «Подписание кода и нотариальная заверка»?

Разберитесь в важности подписания кода для Windows и нотариальной заверки для macOS, обеспечивающих доверие пользователей и соответствие требованиям безопасности. Ты практикуешь Electron Desktop App Development с помощью реального кода, который запускаешь прямо в браузере, и ИИ-репетитор 24/7 отвечает на твои вопросы во время урока.

Нужен ли мне опыт, чтобы начать Electron Desktop App Development?

Предыдущий опыт не требуется. Electron Desktop App Development на CoddyKit структурирован для всех уровней — от новичков до продвинутых, поэтому ты можешь начать отсюда или с самого начала и учиться в своем темпе. Это урок 2 из 4.

Сколько времени занимает урок «Подписание кода и нотариальная заверка»?

Большинство уроков CoddyKit занимают около 5–10 минут. Каждый из них компактный и интерактивный, поэтому ты постоянно делаешь прогресс и продолжаешь с того же места в веб-версии и приложении.

Можно ли писать и запускать код в этом уроке Electron Desktop App Development?

Да. Каждый урок Electron Desktop App Development включает встроенный редактор кода, поэтому ты пишешь и запускаешь реальный код прямо в браузере и получаешь моментальную обратную связь от AI — локальная установка не требуется.

Все уроки этого курса

  1. Кроссплатформенная упаковка
  2. Подписание кода и нотариальная заверка
  3. Распространение через магазины приложений
  4. Автоматизация выпусков с помощью CI/CD
← Назад к Electron Desktop App Development