You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: synapse-electron/README.md
+125Lines changed: 125 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -264,3 +264,128 @@ When incrementing the desktop application for a release, there are **2 versions*
264
264
-**IMPORTANT**: Check the "Set as a pre-release" checkbox
265
265
266
266
**Note**: Replace `X.Y.Z` with the actual semantic version numbers (e.g., `1.2.3`).
267
+
268
+
269
+
270
+
# macOS Code Signing: Artifact Generation Guide
271
+
272
+
**Focus:** Developer ID Application Certificate (for signing `.app` bundles)
273
+
274
+
## Phase 1: Generating the Request (CSR)
275
+
276
+
*Context:* You must generate a certificate signing request on your local Mac to create the Private Key.
277
+
278
+
1.**Open Keychain Access** and go to **Certificate Assistant**\>**Request a Certificate From a Certificate Authority...**
279
+
2.**Generate Request:**
280
+
***User Email:** Your Apple ID email.
281
+
***Common Name:**`[Company] App Signer` (Use a distinct name).
282
+
***Request is:** Saved to disk.
283
+
***Save as:**`Application_Request.csr`.
284
+
285
+
> **Crucial:** Do not delete the new **Private Key** (named `[Company] App Signer`) that appears in your Keychain. This is the "lock" waiting for the certificate.
286
+
287
+
-----
288
+
289
+
## Phase 2: The Apple Portal Handoff
290
+
291
+
*Context:* The Account Holder must use the specific file generated above.
292
+
293
+
**Instructions for Account Holder:**
294
+
295
+
1.**Revoke** any previous/failed certificates to prevent confusion.
296
+
2. Go to **Certificates**, click **(+)**.
297
+
3. Select **Developer ID Application**.
298
+
4. Upload `Application_Request.csr`.
299
+
5.**Download and send back** the resulting `.cer` file (e.g., `developerID_application.cer`).
300
+
301
+
-----
302
+
303
+
## Phase 3: Import & Export (The Keychain Step)
304
+
305
+
*Context:* You must pair the downloaded certificate with your local private key and export it.
306
+
307
+
1.**Import:** Double-click the `.cer` file to install it into your **login** keychain.
308
+
2.**Force Combine & Export:**
309
+
* Select the **"All Items"** tab in Keychain Access.
310
+
* Search for your Common Name (e.g., "App Signer").
311
+
* Hold **Command (⌘)** and select **BOTH** the **Developer ID Application Certificate** AND the matching **Private Key**.
312
+
***Right-click** on the highlighted selection \>**Export 2 items...**.
313
+
***File Format:**`.p12`.
314
+
***Save as:**`certificate-application.p12`.
315
+
***Password:** Set a temporary password (e.g., `temp123`). *You will need this in the next step.*
316
+
317
+
-----
318
+
319
+
## Phase 4: Re-encrypt for CI/CD (The OpenSSL Step)
320
+
321
+
*Context:* Legacy `.p12` files exported from macOS often use RC2-40-CBC encryption, which causes "MAC verification failed" errors in modern GitHub Actions runners. You must re-encrypt the file using AES-256.
322
+
323
+
**Run the following commands in your terminal where you saved `certificate-application.p12`:**
324
+
325
+
### Step 1: Extract Certificate and Private Key
326
+
327
+
*Note: Replace `OLD_COMPLEX_PASSWORD` with the password you set in Phase 3.*
328
+
329
+
```bash
330
+
# Extract certificate (use -legacy flag to handle macOS RC2-40-CBC encryption)
> You should see `PKCS7 Encrypted data: PBES2, PBKDF2, AES-256-CBC` and `MAC: sha256`.
371
+
372
+
-----
373
+
374
+
## Phase 5: Final Artifact Checklist
375
+
376
+
You are ready to configure GitHub Actions. Ensure you have these items saved:
377
+
378
+
1.[ ]**`cert_single_line.b64`** (The file content to paste into GitHub Secret `MACOS_CERTIFICATE`)
379
+
2.[ ]**`NEW_SIMPLE_PASSWORD`** (The string to paste into GitHub Secret `MACOS_CERTIFICATE_PASSWORD`)
380
+
3.[ ]**Team ID** (e.g., `A1B2C3D4E5`)
381
+
4.[ ]**App-Specific Password** (for Notarization)
382
+
383
+
-----
384
+
385
+
## Troubleshooting
386
+
387
+
| Issue | Cause | Solution |
388
+
| :--- | :--- | :--- |
389
+
|**"MAC verification failed"**| The .p12 uses legacy RC2 encryption or the password has special characters escaping in shell. | Perform **Phase 4** exactly as written. Ensure `NEW_SIMPLE_PASSWORD` does not contain complex shell characters. |
390
+
|**Orphaned Key**| Certificate and Key exist but won't export together. | Use the **"Force Combine"** method in Phase 3 (Select both items manually + Right Click). |
391
+
|**"Attribute specified more than once"**| Reusing an old CSR file on Apple's portal. | Generate a fresh CSR in Phase 1. |
0 commit comments