Verify data with public RSA 1024 Openssl key with openssl_verify()?
I got private_key.pem and public_key.pem. The public one is signed by bank. To trying to verify data sent to me by bank i use php method openssl_verify()
So far i have no luck on verifying that data against their public key. I always get 开发者_如何学JAVAthose 2 errors:
error:0407006A:rsa routines:RSA_padding_check_PKCS1_type_1:block type is not 01
error:04067072:rsa routines:RSA_EAY_PUBLIC_DECRYPT:padding check failed
I also did try to just verify it with shell_exec() method, but i get back same errors.
Anyone has seen this and maybe know how to verify it properly?
It could be using OAEP padding. It's PKCS#1 compliant (OAEP defined in PKCS#1 v2.0+) but it does differ from the sole padding scheme PKCS#1 v1.5 defined.
Anyway, my suggestion would be try decrypting it with phpseclib, a pure PHP RSA implementation. The maintainer of that package - unlike the maintainer of the OpenSSL PHP extension - actively support his product.
精彩评论