Or you can create a new private key by executing the following command:

    
ssh-keygen -t rsa -b 2048 -m PEM -f cert_key -q -N ""
    

    Later, you can have CLI tools automatically create a new Mac App Distribution and
Mac Installer Distribution certificate. You can use the same private key for
each new certificate.

Fetch the code signing files from App Store Connect:

    
app-store-connect fetch-signing-files YOUR.APP.BUNDLE_ID \
    --platform MAC_OS \
    --type MAC_APP_STORE \
    --certificate-key=@file:/path/to/cert_key \
    --create
    

    Where cert_key is either your exported Mac App Distribution certificate private key
or a new private key which automatically generates a new certificate.

If you do not have a Mac Installer Distribution certificate,
you can create a new certificate by executing the following: