There is a great question and answer at the link below:
How do I create a self-signed certificate for code signing on Windows?
I am a little confused about the two procedures listed ((a)Creating a self-signed Certificate Authority and (b)Creating a code-signing (SPC) Certificate). Do we do a and then do b or is it an either or ?
Creating a self-signed Certificate Authority (CA)
makecert -r -pe -n "CN=My CA" -ss CA -sr CurrentUser -a sha256 -cy authority -sky signature -sv MyCA.pvk MyCA.cer
Creating a code-signing (SPC) Certificate
makecert -pe -n "CN=My SPC" -a sha256 -cy end -sky signature -ic MyCA.cer -iv MyCA.pvk -sv MySPC.pvk MySPC.cer