Now, let us start:
1. Go to Apple's Developer Program's Member Center. Go to member center. Write your credentials and enter.
NOTE: If you have not registered in Apple's Developer Program, you need to do so before you can sign your code.
2. Under Developer Program Resources, click on Certificates, Identifiers and Profiles. Under Mac Apps Click on Certificates. Then go to your certificate and then Click on Download. Now you have downloaded the Certificate.
3. Find the certificate file that you downloaded, and run it.
Keychain Access program will be opened by default and will put your Certificate under login keychains and certificates category:
4. Download your private key from the Apple's website: In the downloaded folder you will find a key file with .p12 extension which is Mac’s public key (PKCS12) format. Again, open the file and automatically it will be attached to the certificate you just downloaded.
Check whether it is already there as you expect it.
5. Next Step is to get Developer’s ID. Right click on the certificate of Mac developer profile which you want the code to be signed with and click on “Get info”. On the new windows, scroll down and get the SHA1 fingerprint of the certificate:
CODESIGN_REQUIREMENTS="=designated => anchor apple generic and identifier \"org.webapp.xulwrapper\" and ((cert leaf[field.1.2.840.1136126.96.36.199.9] exists) or ( certificate 1[field.1.2.840.1136188.8.131.52.6] exists and certificate leaf[field.1.2.840.1136184.108.40.206.13] exists and certificate leaf[subject.OU] = \"FOO123BAR1\" ))" /usr/bin/codesign -s "$DEVELOPER_ID" -v \ --requirements "$CODESIGN_REQUIREMENTS" \ "$APPDIR"