AopCertClient
class AopCertClient
Aop 证书模式
Properties
string | $appCertSN | ||
$alipayRootCertSN | |||
$alipayRootCertContent | |||
$isCheckAlipayPublicCert | |||
$appId | |||
$rsaPrivateKeyFilePath | |||
$rsaPrivateKey | |||
$gatewayUrl | |||
$format | |||
$apiVersion | |||
$postCharset | |||
$alipayPublicKey | |||
$alipayrsaPublicKey | |||
$debugInfo | |||
$signType | |||
$encryptKey | |||
$encryptType | |||
protected | $alipaySdkVersion |
Methods
No description
No description
No description
No description
No description
No description
No description
No description
从证书中提取序列号
从证书中提取序列号
提取根证书序列号
提取根证书序列号
0x转高精度数字
从证书中提取公钥
验证签名 在使用本方法前,必须初始化AopCertClient且传入公钥参数。 公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。
验证签名 在使用本方法前,必须初始化AopCertClient且传入公钥参数。 公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。
在使用本方法前,必须初始化AopCertClient且传入公私钥参数。 公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。
在使用本方法前,必须初始化AopCertClient且传入公私钥参数。 公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。
在使用本方法前,必须初始化AopCertClient且传入公私钥参数。
在使用本方法前,必须初始化AopCertClient且传入公私钥参数。 公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。
No description
No description
生成用于调用收银台SDK的字符串
页面提交执行方法
No description
No description
加签
No description
No description
RSA单独签名方法,未做字符串处理,字符串处理见getSignContent()
转换字符集编码
Json格式签名内容
No description
No description
No description
XML格式签名内容
No description
No description
No description
验签
No description
No description
No description
建立请求,以表单HTML形式构造(默认)
No description
校验$value是否非空 if not set ,return true; if is null , return true;
No description
发送curl请求
No description
打印日志信息
Details
at line 96
AopCertClient
setEnv(string $env = 'sandbox')
No description
at line 109
AopCertClient
setAppId(string $appId)
No description
at line 120
AopCertClient
setRsaPrivateKey(string $rsaPrivateKey)
No description
at line 131
AopCertClient
setAlipayrsaPublicKey(string $alipayRsaPublicKey)
No description
at line 142
AopCertClient
setAppCertSN(string $appCertSn)
No description
at line 153
AopCertClient
setAlipayRootCertSN(string $alipayRootCertSn)
No description
at line 164
AopCertClient
setSignType(string $signType)
No description
at line 175
AopCertClient
setIsCheckAlipayPublicCert(mixed $isCheckAlipayPublicCert)
No description
at line 188
string
getCertSN(string $certPath)
从证书中提取序列号
at line 200
string
getCertSNByContent($cert)
从证书中提取序列号
at line 211
string|null
getRootCertSN(string $certPath)
提取根证书序列号
at line 222
string|null
getRootCertSNByContent(string $cert)
提取根证书序列号
at line 256
int|string
hex2dec($hex)
0x转高精度数字
at line 271
mixed
getPublicKey($certPath)
从证书中提取公钥
at line 292
bool
rsaCheckV1($params, $rsaPublicKeyFilePath, string $signType = 'RSA')
验证签名 在使用本方法前,必须初始化AopCertClient且传入公钥参数。 公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。
at line 310
bool
rsaCheckV2($params, $rsaPublicKeyFilePath, string $signType = 'RSA')
验证签名 在使用本方法前,必须初始化AopCertClient且传入公钥参数。 公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。
at line 328
mixed|string
checkSignAndDecrypt(array $params, string $rsaPublicKeyFilePath, bool $isCheckSign, bool $isDecrypt, string $signType = 'RSA')
在使用本方法前,必须初始化AopCertClient且传入公私钥参数。 公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。
at line 355
string
encryptAndSign(string $bizContent, string $rsaPublicKeyFilePath, string $charset, bool $isEncrypt, bool $isSign, string $signType = 'RSA')
在使用本方法前,必须初始化AopCertClient且传入公私钥参数。 公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。
at line 384
string
rsaEncrypt(string $data, string $rsaPublicKeyFilePath, $charset)
在使用本方法前,必须初始化AopCertClient且传入公私钥参数。
at line 421
string
rsaDecrypt(string $data)
在使用本方法前,必须初始化AopCertClient且传入公私钥参数。 公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。
at line 449
splitCN($cont, $n, $subnum, $charset)
No description
at line 463
subCNchar($str, $start, $length, $charset = "gbk")
No description
at line 482
string
sdkExecute(object $request, string|null $appAuthToken = null)
生成用于调用收银台SDK的字符串
at line 520
string
pageExecute(object $request, string $httpmethod = "POST", null $appAuthToken = null)
页面提交执行方法
at line 587
getSignContentUrlencode($params)
No description
at line 619
false|mixed|SimpleXMLElement
execute($request, null $authToken = null, null $appInfoAuthtoken = null, null $targetAppId = null)
No description
at line 752
mixed
generateSign($params, string $signType = "RSA")
加签
at line 757
rsaSign($params, $signType = "RSA")
No description
at line 762
getSignContent($params)
No description
at line 794
string
alonersaSign(string $data, string $privatekey, string $signType = "RSA", bool $keyfromfile = false)
RSA单独签名方法,未做字符串处理,字符串处理见getSignContent()
at line 826
array|false|string|string[]|null
charset(null|string $data, $targetCharset)
转换字符集编码
at line 844
SignData
parserJSONSignData($request, $responseContent, $responseJSON)
Json格式签名内容
at line 852
parserJSONSign($responseJSon)
No description
at line 857
parserJSONSignSource($request, $responseContent)
No description
at line 874
parserJSONSource($responseContent, $nodeName, $nodeIndex)
No description
at line 898
SignData
parserXMLSignData($request, $responseContent)
XML格式签名内容
at line 906
parserXMLSign($responseContent)
No description
at line 931
parserXMLSignSource($request, $responseContent)
No description
at line 948
parserXMLSource($responseContent, $nodeName, $nodeIndex)
No description
at line 977
false
checkResponseSign($request, $signData, $resp, $respObject)
验签
at line 1076
parserResponseSubCode($request, $responseContent, $respObject, $format)
No description
at line 1109
verify($data, $sign, $rsaPublicKeyFilePath, $signType = 'RSA')
No description
at line 1139
echoDebug($content)
No description
at line 1151
protected string
buildRequestForm(array $para_temp)
建立请求,以表单HTML形式构造(默认)
at line 1168
protected
fun_adm_each($array)
No description
at line 1188
protected
checkEmpty($value)
校验$value是否非空 if not set ,return true; if is null , return true;
at line 1200
protected
sign($data, $signType = "RSA")
No description
at line 1236
protected bool|string
curl($url, null $postFields = null)
发送curl请求
at line 1288
protected
getMillisecond()
No description
at line 1301
protected
logCommunicationError($apiName, $requestUrl, $errorCode, $responseTxt)
打印日志信息