IDK, pre-windows-10 didn't you just need a ~$200 [1] code signing certificate? Do people usually buy HSMs to store those?
[1] https://www.sslshopper.com/microsoft-authenticode-certificat...
[1] https://www.sslshopper.com/microsoft-authenticode-certificat...
At the time Stuxnet was around, no, not really.