Method | Description | |
---|---|---|
__construct ( $token, $encodingAesKey, $appId ) | 构造函数 | |
decryptMsg ( $msgSignature, $timestamp = null, $nonce, $postData, &$msg ) : integer | 检验消息的真实性,并且获取解密后的明文. | |
encryptMsg ( $replyMsg, $timeStamp, $nonce, &$encryptMsg ) : integer | 将公众平台回复用户的消息加密打包. |
public __construct ( $token, $encodingAesKey, $appId ) | ||
$token | string 公众平台上,开发者设置的token | |
$encodingAesKey | string 公众平台上,开发者设置的EncodingAESKey | |
$appId | string 公众平台的appId |
public decryptMsg ( $msgSignature, $timestamp = null, $nonce, $postData, &$msg ) : integer | ||
$msgSignature | string 签名串,对应URL参数的msg_signature | |
$timestamp | string 时间戳 对应URL参数的timestamp | |
$nonce | string 随机串,对应URL参数的nonce | |
$postData | string 密文,对应POST请求的数据 | |
return | integer | 成功0,失败返回对应的错误码 |
public encryptMsg ( $replyMsg, $timeStamp, $nonce, &$encryptMsg ) : integer | ||
$replyMsg | string 公众平台待回复用户的消息,xml格式的字符串 | |
$timeStamp | string 时间戳,可以自己生成,也可以用URL参数的timestamp | |
$nonce | string 随机串,可以自己生成,也可以用URL参数的nonce | |
return | integer | 成功0,失败返回对应的错误码 |