程序里用的是Windows Cryptography APIs,没有用到其他库。
最初想偷懒,直接用OpenSSL的命令行工具,不知哪里没整对,就是不正确。也许两者实现的细节确实不同,OpenSSL签的,自己可以通过验证,但API就过不了。
没办法,只好老老实实按程序的实现用APIs走其逆过程。
MSDN上那个例子“Example C Program: Signing a Hash and Verifying the Hash Signature”写得不好,又参考其他代码才弄好了。
When you activate a license, Source Insight sends the information you provided, plus a hardware fingerprint to our licensing system over a secure SSL connection so we can match the license to the machine. You can still make most hardware changes without invalidating the installation. We respect your privacy, and we specifically do not share your information with any third party.
另外,它的Deactivation功能比较人性化:
If you decide to stop using Source Insight, or want to use your license on a different machine, you should first deactivate your license on your old machine by selecting Help > Manage License, and selecting "Deactivate License". This reduces your activation count so that you can activate it on another machine. A single license gives you up to two machine activations.