Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Environment Variables

cargo-codesign reads secret values exclusively from environment variables. The sign.toml file stores env var names, never values.

.env auto-loading

cargo-codesign uses dotenvy to auto-load a .env file from the current directory. This makes local development convenient:

# .env (never commit)
APPLE_ID=you@example.com
APPLE_TEAM_ID=ABCDE12345
APPLE_APP_PASSWORD=xxxx-xxxx-xxxx-xxxx

macOS — apple-id mode

Env var (default name)Description
APPLE_IDApple ID email address
APPLE_TEAM_ID10-character Apple Developer Team ID
APPLE_APP_PASSWORDApp-specific password for notarization

macOS — api-key mode

Env var (default name)Description
MACOS_CERTIFICATEBase64-encoded .p12 certificate
MACOS_CERTIFICATE_PASSWORDPassword for the .p12 file
APPLE_NOTARIZATION_KEYBase64-encoded .p8 App Store Connect API key
APPLE_NOTARIZATION_KEY_IDAPI key ID (from App Store Connect)
APPLE_NOTARIZATION_ISSUER_IDIssuer ID (from App Store Connect)

Windows

Env var (default name)Description
AZURE_TENANT_IDAzure AD tenant ID
AZURE_CLIENT_IDAzure AD client/application ID
AZURE_CLIENT_SECRETAzure AD client secret
AZURE_SIGNING_ENDPOINTAzure Trusted Signing endpoint URL
AZURE_SIGNING_ACCOUNT_NAMETrusted Signing account name
AZURE_SIGNING_CERT_PROFILECertificate profile name

Linux

Env var (default name)Description
COSIGN_PRIVATE_KEYCosign private key (for cosign method)

Update signing

Env var (default name)Description
UPDATE_SIGNING_KEYBase64-encoded Ed25519 private key

Custom env var names

All env var names are configurable in sign.toml. The names above are conventions — you can use any name:

[macos.env]
apple-id = "MY_CUSTOM_APPLE_ID_VAR"