2

使用 openssl 我在服务器上创建了签名文档,请参阅下面的命令。

------创建私钥。

openssl pkcs12 -in "D:\Cummins Issues\XML  Encryption\mycredentialsandkey2010.pfx"  -nodes -nocerts -out "D:\privatekey.pem" -nodes

------创建公钥。

openssl rsa -in "D:\privatekey.pem" -pubout -out "D:\rsapublickey.pem"

------创建签名文档。

openssl dgst -sha1 -sign "D:\privatekey.pem" -out "D:\ProductInformation_xml.cipher" "D:\ProductInformation.xml"

现在我可以使用如下所示的 opensll 验证数字签名

- -核实

openssl dgst -sha1 -verify "D:\rsapublickey.pem" -signature "D:\ProductInformation_xml.cipher" "D:\ProductInformation.xml"

但我需要在客户端应用程序中使用 C++ 和 Windows API 验证数字签名(没有 openssl 库或源代码)。我知道使用公钥和哈希我们可以验证数字签名。请尽快向我提供伪代码或 Windows API。

任何帮助表示赞赏。

4

2 回答 2

0

为什么不能使用 libssl?这是明显的下降路线。算法本身是RSASHA1 ,尽管你真的不应该尝试自己动手。

谷歌搜索“microsoft ssl library”只会产生大量漏洞。不完全是!

于 2011-07-20T12:40:55.963 回答
0

Microsoft 的 CryptoAPI 将允许您签署和验证数据。

你应该注意到微软从 Windows vista 开始就引入了CNG 。所以评估你的要求。

您可以使用 CryptoAPI从MSDN中找到用于签名和验证的示例源

于 2011-07-20T17:13:52.197 回答