I found a brilliant use of SignerSignEx
on C# here: https://stackoverflow.com/a/26372061
It works fine on the dev. machine, but on Azure WebJob you have to use something like this:
X509Certificate2 cert = new X509Certificate2(certPath,
certPassword,
X509KeyStorageFlags.MachineKeySet |
X509KeyStorageFlags.PersistKeySet |
X509KeyStorageFlags.Exportable);
But with X509KeyStorageFlags.MachineKeySet
flag SignerSignEx
returns hResult=-2146885626 (Error code 0x80092006 - No provider was specified for the store or object.)
How I can fix it and why MachineKeySet has influence on provider ? Thanks!
After some research I almost sure (99% :) ) that SignerSignEx
just doesn't work without user's profile.
So I used mono + openssl.
Looks like a solution.
You can see an example of authenticode with Mono at: https://github.com/mono/mono/blob/master/mcs/tools/security/signcode.cs
Bye, have a beautiful time!
User contributions licensed under CC BY-SA 3.0