我正在尝试通过openssl_verify()
函数验证签名:
PHP代码:
$signature = pack("H*", $ecdsa);
$verified = openssl_verify($data, $signature, $public_key, "sha256");
错误讯息:
错误:错误:0606C06E:数字信封例程:EVP_VerifyFinal:错误 公钥类型
什么意思是错误消息“错误的公钥类型”?
参数
数据参数:
41.50978123OK1140720161227221826993f133b2b22d61a6e5bcc5323c00438b489ffac9301b20811d696eb03d7
ECDSA param:
304502201dc866a213bdcf42fad84ab8d00dc3ef4d0e10450fd6110070a866dbdeccc831022100f8062057f3022db78f7df3bff40547ef76be58eb55cb9f72a4b1ecc9f34ed54b
公钥:
----- BEGIN PUBLIC KEY ----- MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEozvFM1FJP4igUQ6kP8ofnY7ydIWksMDk1IKXyr / T RDoX4sTMmmdiIrpmCZD4CLDtP0j2LfD7saSIc8kZUwfILg == ----- END PUBLIC KEY -----