A Code Signing certificate in macOS allows you to sign modules or programs using codesign tool. Code signing is a security measure used by Gatekeeper in macOS to allow only verified applications to execute.
Code Signing certificate can be generated using Keychain Access utility. It has to be issued by a Certified Authority (CA), which you need to create if you don't already have one.
Steps to create code signing certificate using Keychain Access:
Launch
Keychain Access.

Go to
Keychain Access →
Certificate Assistant →
Create a Certificate from the menu bar.

Set the name of the certificate.

Click on
Identity Type select list.

Select
Leaf from the list.

Click on
Certificate Type select list.

Select
Code Signing from the list.

Click
Create to continue.

Select
CA or issuer from the list and click
Create.
Click
Done to finish the process.
Discuss the article:
Comment anonymously. Login not required.