对于这个方法:
ISteamUserAuth
AuthenticateUser
Version: 1
HTTP Method: POST
Parameters:
Name: steamid
Type: uint64
Optional:
Description: Should be the users steamid, unencrypted.
Parameters:
Name: sessionkey
Type: rawbinary
Optional:
Description: Should be a 32 byte random blob of data, which is then encrypted with RSA using the Steam system's public key. Randomness is important here for security.
Parameters:
Name: encrypted_loginkey
Type: rawbinary
Optional:
Description: Should be the users hashed loginkey, AES encrypted with the sessionkey.
我需要 3 个参数。对于第二个参数sessionkey
,我需要使用Steam系统的公钥对其进行加密。我究竟如何得到它?
经过一些研究,我发现我必须通过使用证书来获取公钥,它应该类似于 this。 .
我使用的是 php,因此我使用这段代码从证书中检索公钥:
<?php
$pub_key = openssl_pkey_get_public(file_get_contents('./cert.crt'));
$keyData = openssl_pkey_get_details($pub_key);
file_put_contents('./key.pub', $keyData['key']);
?>
我对使用哪个证书感到困惑。我是否使用 Steam 网站的证书? (cert.crt
就是证书)
最佳答案
我也有同样的疑问。我还没有尝试过,但是:
curl -X POST "http://store.steampowered.com/login/getrsakey/"
-d username="your_username"
给你一个RSA key ...
关于php - 如何获得Steam公钥?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27083356/