php openssl signed string not getting verified by Win CryptoAPI

前端 未结 1 1325
甜味超标
甜味超标 2021-01-17 02:28

I am signing some text using php openssl and trying to verify it in the windows app using CryptoApi but validation always fails. Please help me out.

PHP Cod

1条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-17 03:16

    To verify using CryptoAPI, reverse the signature and then verify. This is because, on Windows, byte ordering is different from OpenSSL (that is big endian).

    You can do it in the following way

    for(i=0, j=dwSigLen-1; i

    After that, verify signature.

    This question can help you as it faces similar problem (signed from CryptoAPI and verify using OpenSSL).

    0 讨论(0)
提交回复
热议问题