Microsoft Authenticode is certainly not a big hush-hush secret and you can download technical specs and more about how Authenticode works. You can also download technical information about Windows PE file format. Since you did not clearly state weather you wanted something for Linux, Mac, or a smartphone, I can not provide you with an adequate solution. However, with the information I provided you above, along with OpenSSL, you should be able to create your own program to do this in the language and OS of your choice.