generated from root/miduo_server
疯体ios修改支付paykey
parent
e24e15123c
commit
e5abf0c7f0
|
@ -25,7 +25,7 @@ public class FengTiIosRechargeController {
|
|||
private static final Logger LOGGER = LoggerFactory.getLogger(FengTiIosRechargeController.class);
|
||||
private static final String callbackkey = "53780900079388195716762718742907";
|
||||
|
||||
private static final String publicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDmJHw+qP7vzf+QyL2/AC+dItwDMcoClG5csqiUgL6vl4801HogkBGHI9eQZuFqwJKJENoIkPA5apuitGJIor4CaomqiuWHMY+oIywPP+hXelcxzVDf8nx8XWe2f8WVbHlfI9EL40cvcijl5xv2xXGfxqFwvWzbC+64nszfD1HiewIDAQAB";
|
||||
private static final String payKey = "2e92cbb7faa7e37e0c5a38723b1d2acd";
|
||||
|
||||
@RequestMapping(value = "/FengTiIosCallback")
|
||||
public String FengTiIoCallback(HttpServletRequest request) throws Exception {
|
||||
|
@ -77,9 +77,9 @@ public class FengTiIosRechargeController {
|
|||
String substring = builder.substring(0, builder.length() - 1);
|
||||
try {
|
||||
// 2、生成签名
|
||||
return verify(publicKey,substring,sign);
|
||||
return verify(payKey,substring,sign);
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("疯体ios待签名字符串================>publicKey:{},signedData:{},signature:{}",publicKey,substring,sign);
|
||||
LOGGER.error("疯体ios待签名字符串================>publicKey:{},signedData:{},signature:{}", payKey,substring,sign);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -88,16 +88,15 @@ public class FengTiIosRechargeController {
|
|||
X509EncodedKeySpec keySpecX509 = new X509EncodedKeySpec(Base64.getDecoder().decode(pubKeyStr));
|
||||
KeyFactory kf = KeyFactory.getInstance("RSA");
|
||||
RSAPublicKey pubKey = (RSAPublicKey) kf.generatePublic(keySpecX509);
|
||||
|
||||
System.out.println("parse key success");
|
||||
LOGGER.info("parse key success");
|
||||
try {
|
||||
Signature sig;
|
||||
sig = Signature.getInstance("SHA1withRSA");
|
||||
sig.initVerify(pubKey);
|
||||
System.out.println("initVerify success");
|
||||
LOGGER.info("initVerify success");
|
||||
// sig.update(signedData.getBytes());
|
||||
sig.update(Base64.getDecoder().decode(Base64.getEncoder().encode(signedData.getBytes())));
|
||||
System.out.println("update success");
|
||||
LOGGER.info("update success");
|
||||
|
||||
if (!sig.verify(Base64.getDecoder().decode(signature.getBytes()))) {
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue