mirror of
https://github.com/cypress-io/cypress.git
synced 2026-01-24 16:09:32 -06:00
3.0 KiB
3.0 KiB
Code Signing
Code signing is done for the Windows and Mac distributions of Cypress when they are built in CI.
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.
Rotating the Mac code signing key
- On a Mac, log in to Xcode using Cypress's Apple developer program identity.
- Follow Apple's Create, export, and delete signing certificates instructions:
- Follow "View signing certificates".
- Follow "Create a signing certificate", and choose the type of "Developer ID Application" when prompted.
- Follow "Export a signing certificate". Set a strong passphrase when prompted, which will later become
CSC_KEY_PASSWORD.
- Upload the exported, encrypted
.p12file to the Code Signing folder in Google Drive and obtain a public direct download link. - Within the
test-runner:sign-mac-binaryCircleCI context, setCSC_LINKto that direct download URL and setCSC_KEY_PASSWORDto the passphrase used to encrypt thep12file.
Rotating the Windows code signing key
- Generate a certificate signing request (CSR) file using
openssl. For example:# generate a new private key openssl genrsa -out win-code-signing.key 4096 # create a CSR using the private key openssl req -new -key win-code-signing.key -out win-code-signing.csr - Obtain a certificate by submitting the CSR to SSL.com using the Cypress SSL.com account.
- If renewing, follow the renewal instructions.
- If rotating, contact SSL.com's support to request certificate re-issuance.
- 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-----) - 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 becomeCSC_KEY_PASSWORD.➜ openssl pkcs12 -export -inkey win-code-signing.key -in win-code-signing.crt -out encrypted-win-code-signing.pfx Enter Export Password: <password> Verifying - Enter Export Password: <password> - Upload the
encrypted-win-code-signing.pfxfile to the Code Signing folder in Google Drive and obtain a public direct download link. - Within the
test-runner:sign-windows-binaryCircleCI context, setCSC_LINKto that direct download URL and setCSC_KEY_PASSWORDto the passphrase used to encrypt thepfxfile.