无法validationopenssl公钥
我正在尝试使用openssl_verify()
来validation$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()提供的key参数不能被强制转换成公钥
POST信息来自使用此Game Center方法的iOS应用程序。