我正在尝试使用openssl_verify()
与$payload
验证$publicKey
。
这是我的代码:
$publicKey = openssl_pkey_get_public($_POST['publicKeyURL']);
$playerID = $_POST['playerID'];
$timestamp = intval($_POST['timestamp']);
$signature = base64_decode($_POST['signature']);
$salt = base64_decode($_POST['salt']);
$payload = $playerID . $bundleID . $timestamp . $salt;
$status = openssl_verify($payload, $signature, $publicKey);
openssl_free_key($publicKey);
if ($status == 1) { /* */ }
我收到以下错误:
openssl_verify()提供的密钥参数不能强制转换为公钥
POST信息来自使用this Game Center method的iOS应用。