【发布时间】:2011-10-09 07:12:56
【问题描述】:
使用 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。
感谢任何帮助。
【问题讨论】:
-
这是图书馆的目的,而不是重新发明轮子。如果不能使用 openssl 或 crypto++ 或 Botan,那么您将不得不实现自己的算法。另请注意,使用这些库中的任何一个静态编译您的客户端都不会在您的客户端中包含整个库,仅包含您使用的库。
标签: c++ visual-c++ digital-signature cryptoapi