Skip to content

Commit 0500997

Browse files
docs(guides): add more detail to code-signing (#25794)
Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com>
1 parent 0618712 commit 0500997

File tree

1 file changed

+27
-10
lines changed

1 file changed

+27
-10
lines changed

guides/code-signing.md

+27-10
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,37 @@ Code signing is done for the Windows and Mac distributions of Cypress when they
44

55
`electron-builder` handles code signing during the `create-build-artifacts` jobs. This guide assumes that the reader is already familiar with [`electron-builder`'s Code Signing documentation](https://www.electron.build/code-signing).
66

7-
## Installing a new Mac code signing key
7+
## Rotating the Mac code signing key
88

9-
Follow the directions supplied by `electron-builder`: https://www.electron.build/code-signing#travis-appveyor-and-other-ci-servers
9+
1. On a Mac, log in to Xcode using Cypress's Apple developer program identity.
10+
2. Follow Apple's [Create, export, and delete signing certificates](https://help.apple.com/xcode/mac/current/#/dev154b28f09) instructions:
11+
1. Follow "View signing certificates".
12+
2. Follow "Create a signing certificate", and choose the type of "Developer ID Application" when prompted.
13+
3. Follow "Export a signing certificate". Set a strong passphrase when prompted, which will later become `CSC_KEY_PASSWORD`.
14+
3. Upload the exported, encrypted `.p12` file to the [Code Signing folder][code-signing-folder] in Google Drive and obtain a public [direct download link][direct-download].
15+
4. Within the `test-runner:sign-mac-binary` CircleCI context, set `CSC_LINK` to that direct download URL and set `CSC_KEY_PASSWORD` to the passphrase used to encrypt the `p12` file.
1016

11-
Set the environment variables `CSC_LINK` and `CSC_KEY_PASSWORD` in the `test-runner:sign-mac-binary` CircleCI context.
17+
## Rotating the Windows code signing key
1218

13-
## Installing a new Windows code signing key
14-
15-
1. Obtain the private key and full certificate chain in ASCII-armored PEM format and store each in a file (`-----BEGIN PRIVATE KEY-----`, `-----BEGIN CERTIFICATE-----`)
16-
2. Using `openssl`, convert the plaintext PEM public and private key to binary PKCS#12/PFX format and encrypt it with a real strong password.
19+
1. Generate a certificate signing request (CSR) file using `openssl`. For example:
20+
```shell
21+
# generate a new private key
22+
openssl genrsa -out win-code-signing.key 4096
23+
# create a CSR using the private key
24+
openssl req -new -key win-code-signing.key -out win-code-signing.csr
25+
```
26+
2. Obtain a certificate by submitting the CSR to SSL.com using the Cypress SSL.com account.
27+
* If renewing, follow the [renewal instructions](https://www.ssl.com/how-to/renewing-ev-ov-and-iv-certificates/).
28+
* If rotating, contact SSL.com's support to request certificate re-issuance.
29+
3. Obtain the full certificate chain from SSL.com's dashboard in ASCII-armored PEM format and save it as `win-code-signing.crt`. (`-----BEGIN PRIVATE KEY-----`, `-----BEGIN CERTIFICATE-----`)
30+
4. Using `openssl`, convert the plaintext PEM public and private key to binary PKCS#12/PFX format and encrypt it with a strong passphrase, which will later become `CSC_KEY_PASSWORD`.
1731
```shell
18-
➜ openssl pkcs12 -export -inkey key.pem -in cert.pem -out encrypted.pfx
32+
➜ openssl pkcs12 -export -inkey win-code-signing.key -in win-code-signing.crt -out encrypted-win-code-signing.pfx
1933
Enter Export Password: <password>
2034
Verifying - Enter Export Password: <password>
2135
```
22-
3. Upload the `encrypted.pfx` file to the Cypress App Google Drive and obtain a [direct download link](http://www.syncwithtech.org/p/direct-download-link-generator.html).
23-
4. Within the `test-runner:sign-windows-binary` CircleCI context, set `CSC_LINK` to that URL and `CSC_KEY_PASSWORD` to the password.
36+
5. Upload the `encrypted-win-code-signing.pfx` file to the [Code Signing folder][code-signing-folder] in Google Drive and obtain a public [direct download link][direct-download].
37+
6. Within the `test-runner:sign-windows-binary` CircleCI context, set `CSC_LINK` to that direct download URL and set `CSC_KEY_PASSWORD` to the passphrase used to encrypt the `pfx` file.
38+
39+
[direct-download]: https://www.syncwithtech.org/p/direct-download-link-generator.html
40+
[code-signing-folder]: https://drive.google.com/drive/u/1/folders/1CsuoXRDmXvd3ImvFI-sChniAMJBASUW

0 commit comments

Comments
 (0)