Interface SignOptions

Options for codesigning a packaged .app bundle.

interface SignOptions {
    app: string;
    batchCodesignCalls?: boolean;
    binaries?: string[];
    identity?: string;
    identityValidation?: boolean;
    ignore?: string | string[] | ((file) => boolean);
    keychain?: string;
    optionsForFile?: ((filePath) => PerFileSignOptions);
    platform?: ElectronMacPlatform;
    preAutoEntitlements?: boolean;
    preEmbedProvisioningProfile?: boolean;
    provisioningProfile?: string;
    strictVerify?: string | boolean;
    type?: SigningDistributionType;
    version?: string;
}

Hierarchy

  • _SignOptions
    • SignOptions

Properties

app: string

Path to the application package. Needs to end with the file extension .app.

batchCodesignCalls?: boolean

Combine all files with identical CLI arguments in a single codesign call instead of running codesign once for each of those files. This minimizes the number of child processes that need to be spawned and reduces the time it takes to sign all files.

Default Value

false

binaries?: string[]

Array of paths to additional binaries that will be signed along with built-ins of Electron.

Default Value

undefined

identity?: string

Name of the certificate to use when signing.

Default Value

Selected with respect to provisioningProfile and platform from the selected keychain.

  • mas will look for 3rd Party Mac Developer Application: * (*)
  • darwin will look for Developer ID Application: * (*) by default.
identityValidation?: boolean

Flag to enable/disable validation for the signing identity. If enabled, the identity provided will be validated in the BaseSignOptions.keychain | keychain specified.

Default Value

true

ignore?: string | string[] | ((file) => boolean)

Defines files that will be skipped during the code signing process. This property accepts a regex, function or an array of regexes and functions. Elements of other types are treated as RegExp.

File paths matching a regex or returning a true value from a function will be ignored.

Type declaration

    • (file): boolean
    • Parameters

      • file: string

      Returns boolean

Default Value

undefined

keychain?: string

The keychain name.

Default Value

login

optionsForFile?: ((filePath) => PerFileSignOptions)

Function that receives the path to a file and can return the entitlements to use for that file to override the default behavior. The object this function returns can include any of the following optional keys. Any properties that are returned override the default values that @electron/osx-sign generates. Any properties not returned use the default value.

Type declaration

Returns

Override signing options

Build platform of your Electron app. Allowed values: darwin (Direct Download App), mas (Mac App Store).

Default Value

Determined by presence of Squirrel.framework within the application bundle, which is used for non-MAS apps.

preAutoEntitlements?: boolean

Flag to enable/disable entitlements automation tasks necessary for code signing most Electron apps.

  • Adds com.apple.security.application-groups to the entitlements file
  • Fills in the ElectronTeamID property in Info.plist with the provisioning profile's Team Identifier or by parsing the identity name.

Default Value

true

preEmbedProvisioningProfile?: boolean

Flag to enable/disable the embedding of a provisioning profile into the app's Contents folder. Will use the profile from OnlySignOptions.provisioningProfile if provided. Otherwise, it searches for a .provisionprofile file in the current working directory.

Default Value

true

provisioningProfile?: string

Path to a provisioning profile, which can be used to grant restricted entitlements to your app.

See Apple Documentation for more details.

strictVerify?: string | boolean

Flag to enable/disable the --strict flag when verifying the signed application bundle. Also supports string values to specify which strict restrictions to use, see codesign man page for supported values.

Default Value

true

Type of certificate to use when signing a MAS app.

Default Value

"distribution"

version?: string

Build version of Electron. Values may be like: 1.1.1, 1.2.0. For use for signing legacy versions of Electron to ensure backwards compatibility.