2

我遇到了 CryptVerifySignature 返回 NTE_NO_MEMORY 的问题(CSP 在操作期间内存不足。)

我正在尝试验证使用 OpenSSL 生成的签名,我已经解码了 PEM 公钥,反转了字节序列并将其导入。

我已经尝试明确指定 MS 增强提供程序,并且我的密钥长度为 4096 位(最大<16384 位)。

我在论坛上看到了一些建议内存对齐问题的评论,但我使用的是 Intel Pentium Dual-Core,而且我的缓冲区是 32 位对齐的。

有人见过这个问题吗?

4

1 回答 1

0

It is good to know that the problem is solved by sing RSA_private_encrypt. My case is reverse of you. I signed using CryptSignHash and verify it using RSA_verify.

I noticed that byte order of signature generated by CryptSignHash and RSA_sign for the same data is exactly reverse. Check out this link.

Please try to reverse the bytes and see if it works for you.

I have successfully done sign using CryptSignHash and verify using RSA_verify and it is perfectly working.

于 2013-04-13T15:45:00.853 回答