# 统一 API 参数
# 内容
参数名 | 是否必填 | 类型 | 说明 |
---|---|---|---|
sign | 是 | string | param 的RSA签名 |
param | 是 | string | 请求参数字符串 |
# 示例
{
"sign": "abcdef",
"param": "{}"
}
# 说明
- BluePay 会根据具体接口文档,构造请求参数,将请求参数格式化为 JSON 格式,作为
param
的值; - BluePay 使用 BluePay 的 RSA 私钥对
param
进行签名,得到的值作为sign
的值; - 商户在收到 BluePay 的请求时,使用 BluePay 的 RSA 公钥对
param
进行验证签名,如果签名与sign
一致,则证明该请求是由 BluePay 请求的; - BluePay 的 RSA 公钥请向 BluePay 管理员索取。
# 附录 RSA 使用示例(Java 语言)
生成RSA密钥对:
import java.security.*;
import java.util.Base64;
public class RsaGenerateKeyPair {
public static void main(String[] args) throws NoSuchAlgorithmException {
KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA");
keyPairGenerator.initialize(4096);
KeyPair keyPair = keyPairGenerator.genKeyPair();
PublicKey publicKey = keyPair.getPublic();
byte[] publicKeyBytes = publicKey.getEncoded();
String publicKeyBase64 = Base64.getEncoder().encodeToString(publicKeyBytes);
System.out.println(publicKeyBase64);
PrivateKey privateKey = keyPair.getPrivate();
byte[] privateKeyBytes = privateKey.getEncoded();
String privateKeyBase64 = Base64.getEncoder().encodeToString(privateKeyBytes);
System.out.println(privateKeyBase64);
}
}
RSA密钥长度设置为 4096
RSA 公钥请提交给 BluePay,请不要透露给任何第三方。
RSA 私钥由商户保管,请不要透露给任何人。
当商户请求 BluePay 的 Open API 时,商户使用 RSA 私钥对请求参数进行签名,BluePay 会使用商户提供的 RSA 公钥对请求中的签名进行验证。如果验证失败,BluePay 服务器会拒绝处理请求。
# 示例密钥对
RSA 公钥:
MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAnFPgpmzqcKVGp1Ci/WUPzPkhBnojDwPDBFWbB6RBXKjU8Pdp+n9K7rA0ZP6BD19O4MMJwYxG9n7zf7/IboA+bFfW/jsBGi41g7wBafbJ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/n8RWL+xXZpJYxLX6FDxLdUi5vGLGNiBa064C1YJvJGX2c3E7/hFfdGIXwZXuYR03l49UUwO0W4U4IPcaNf8ZPM8gxKVRh6R0Ne67h01FDzrg5+gYVx1H4hlg/dfFO6YwmS7zsZDzOy53oWYGZcHQH0b8lYKJr/PcSjoYJPtazWoeeAUfnXS8NXG+vsRqccSSQzCPrK33ECggEAbr3OYFNmo9D/Ud3zhTFT4wV2ZybfeVgDdI2drWUNTxdHf2FNYxNMYu3IFmyzqpvr7CSOXzLBGfvQxMa1qZZ4nM4Jd3Ai5HTW3kU9HLqVs8pbBdTNY5MNA+cDSGNZeUjcqjnu/5az6T92ZVigBkOjKIjB0hlrQR/ADZLwbABVK3ISNDbffAm4geyVhk3EkJBs+YIYhoWJ78E1/Y94WEPL5qPJkTG4PhAl+Krjwaq6paEwG8FEHZ5MuqwDXlG2EOMJ9j6s1UwJ0cpyWOtNBSWl+7YnQCJZCQiMmcDorCh/WEM+X7t1VxnxmDsOQ336gLPP/EYEaA8i78TMwvAVt1bN1g==
# RSA 签名:
import java.security.KeyFactory;
import java.security.Signature;
import java.security.spec.PKCS8EncodedKeySpec;
import java.util.Base64;
public class RsaSign {
public static final String PRIVATE_KEY = "MIIJQgIBADANBgkqhkiG9w0BAQEFAASCCSwwggkoAgEAAoICAQCcU+CmbOpwpUanUKL9ZQ/M+SEGeiMPA8MEVZsHpEFcqNTw92n6f0rusDRk/oEPX07gwwnBjEb2fvN/v8hugD5sV9b+OwEaLjWDvAFp9snEEpdB5ex0TxpHDsFy+OtNsvoRVSfaQxyLZ30Ew8yw8cLIOa5tUhVU37SvF+3S/DZHmNsP+SDt7Qrj6WznTl5jwpG/aukt0SWHJigD4+kUZn/zgWE7ScIZNBkLPh1wgr1rFnxFcqlVlBSi0F9srPNiYLwVBTgx5Cnm9O23IS53I7T/0+1lQQSDWw3bXthnLAd5LbvjTfUXx0MLtp8PaJVMRLWhsiiq/AScP0IN9JuYXSnAu+F4uF0bJWeHcWYy9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9JTGUidRjBkpZvFvjfJRgxvaT9fE9KeCJcnev0rF5Dt8opubf06rJJcBJilK+8C9SXBtcTDgTlBUpfG52c/n8RWL+xXZpJYxLX6FDxLdUi5vGLGNiBa064C1YJvJGX2c3E7/hFfdGIXwZXuYR03l49UUwO0W4U4IPcaNf8ZPM8gxKVRh6R0Ne67h01FDzrg5+gYVx1H4hlg/dfFO6YwmS7zsZDzOy53oWYGZcHQH0b8lYKJr/PcSjoYJPtazWoeeAUfnXS8NXG+vsRqccSSQzCPrK33ECggEAbr3OYFNmo9D/Ud3zhTFT4wV2ZybfeVgDdI2drWUNTxdHf2FNYxNMYu3IFmyzqpvr7CSOXzLBGfvQxMa1qZZ4nM4Jd3Ai5HTW3kU9HLqVs8pbBdTNY5MNA+cDSGNZeUjcqjnu/5az6T92ZVigBkOjKIjB0hlrQR/ADZLwbABVK3ISNDbffAm4geyVhk3EkJBs+YIYhoWJ78E1/Y94WEPL5qPJkTG4PhAl+Krjwaq6paEwG8FEHZ5MuqwDXlG2EOMJ9j6s1UwJ0cpyWOtNBSWl+7YnQCJZCQiMmcDorCh/WEM+X7t1VxnxmDsOQ336gLPP/EYEaA8i78TMwvAVt1bN1g==";
public static void main(String[] args) throws Exception {
String param = "{\"appId\":\"str1\",\"appName\":\"str2\",\"channelCode\":\"str3\",\"mchOrderId\":\"str4\",\"amunt\":200,\"notifyUrl\":\"str5\",\"customerName\":\"str6\",\"email\":\"str7\",\"mobile\":\"str8\",\"remark\":\"str\"}";
Signature signature = Signature.getInstance("SHA256withRSA");
signature.initSign(KeyFactory.getInstance("RSA").generatePrivate(new PKCS8EncodedKeySpec(Base64.getDecoder().decode(PRIVATE_KEY))));
signature.update(param.getBytes());
byte[] bytes = signature.sign();
String sign = Base64.getEncoder().encodeToString(bytes);
System.out.println(sign);
}
}
sign
的值:
TRFUJBoPDGaxXGCPp6BdMtRX4KjsfcPLQNkB95WCbO47LCU6NEohiNcIj1G7RG9OfbeYC3VrMXj7NnRrsvVnZQNUq1F5FIOb0C52qYjYimzY5MXpTBEgZ/Fxg75b9g5/tQAN48tQX3/gPTaJudeyT3POwsHx2jNBiJoV59nPEXFT56X3BzsXjLejEVlB2CuVBAOo8zQ0smq9eqrplWY+nTgwS3LY5tdrbHlMbxIj4Jfn+GTZBqrlC80GgFlaAR3iU8p4Jyjmb2HBjUUO6cs/F6JRwPrZdVjlmL+4dFd+GCL8QEAWs+7epVjIE5rIF7XoLSvenryW3IR0H3OPAtj3ETEekCkttC7sDynPDOkjhSE5uwc0HtYyUFVxXQJAYPNSNWXYxVQFSXzaVdEzgdqSaRzLuSrYzpT38ua/ZtzhvpWAyeWvUSONP6q4ZJEWcDsafDhy4/LLKjdOisiLgaBHiiaOYZQYqo6p7pPE9Rv8/MIZgm5qXqVEC5OI+tYeMssSMZIrnd1jDkjW+h1RpuuvD0pmYQjrhk9/+hH6empXLnCfSA5kzGw6shi8c/XbiKWOaqgSTLsHXxmjATDdSKjuQk4VJ4aNxcve1G8Tx7FqWxBCVESkJPRODMnp6S//dZmCO9+xNVPCwhFOArMH/AB+YwbFPsMVku2J12Kk96sy/mo=
# RSA 签名验证
import java.security.KeyFactory;
import java.security.Signature;
import java.security.spec.X509EncodedKeySpec;
import java.util.Base64;
public class RsaVerifySign {
public static final String PUBLIC_KEY = "MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAnFPgpmzqcKVGp1Ci/WUPzPkhBnojDwPDBFWbB6RBXKjU8Pdp+n9K7rA0ZP6BD19O4MMJwYxG9n7zf7/IboA+bFfW/jsBGi41g7wBafbJxBKXQeXsdE8aRw7BcvjrTbL6EVUn2kMci2d9BMPMsPHCyDmubVIVVN+0rxft0vw2R5jbD/kg7e0K4+ls505eY8KRv2rpLdElhyYoA+PpFGZ/84FhO0nCGTQZCz4dcIK9axZ8RXKpVZQUotBfbKzzYmC8FQU4MeQp5vTttyEudyO0/9PtZUEEg1sN217YZywHeS274031F8dDC7afD2iVTES1obIoqvwEnD9CDfSbmF0pwLvheLhdGyVnh3FmMvQeturf+cTYZotP7igToL1MkmTIlSJ2q2pzPNaz0dyBorxB28WlxCuPRZuRCNzhdz/H694ytymEpwqXUo5Vbcfe+QgVFKduhnYapY4Ntv8oSdsH2MeKb5dhc1sO+I0fqrIW25zUOH8ECWQbgV50I7QIPOhKuLOkZW/EEG2epwlY83HqNrKhH6Wd+DXEjimz9zRmCNRboA8MswN8TRv6vGnmP8rFbPiIl/pBADFViiF+TP08O2VWb/9RaXils0MJfhMvTZ6PjhScIKtX9q6wT28gHYIdBD5UfrKLPndJMxM9u3HzWYCwhxa4boxu2+3KLwd7zFECAwEAAQ==";
public static void main(String[] args) throws Exception {
String param = "{\"appId\":\"str1\",\"appName\":\"str2\",\"channelCode\":\"str3\",\"mchOrderId\":\"str4\",\"amunt\":200,\"notifyUrl\":\"str5\",\"customerName\":\"str6\",\"email\":\"str7\",\"mobile\":\"str8\",\"remark\":\"str\"}";
String sign = "TRFUJBoPDGaxXGCPp6BdMtRX4KjsfcPLQNkB95WCbO47LCU6NEohiNcIj1G7RG9OfbeYC3VrMXj7NnRrsvVnZQNUq1F5FIOb0C52qYjYimzY5MXpTBEgZ/Fxg75b9g5/tQAN48tQX3/gPTaJudeyT3POwsHx2jNBiJoV59nPEXFT56X3BzsXjLejEVlB2CuVBAOo8zQ0smq9eqrplWY+nTgwS3LY5tdrbHlMbxIj4Jfn+GTZBqrlC80GgFlaAR3iU8p4Jyjmb2HBjUUO6cs/F6JRwPrZdVjlmL+4dFd+GCL8QEAWs+7epVjIE5rIF7XoLSvenryW3IR0H3OPAtj3ETEekCkttC7sDynPDOkjhSE5uwc0HtYyUFVxXQJAYPNSNWXYxVQFSXzaVdEzgdqSaRzLuSrYzpT38ua/ZtzhvpWAyeWvUSONP6q4ZJEWcDsafDhy4/LLKjdOisiLgaBHiiaOYZQYqo6p7pPE9Rv8/MIZgm5qXqVEC5OI+tYeMssSMZIrnd1jDkjW+h1RpuuvD0pmYQjrhk9/+hH6empXLnCfSA5kzGw6shi8c/XbiKWOaqgSTLsHXxmjATDdSKjuQk4VJ4aNxcve1G8Tx7FqWxBCVESkJPRODMnp6S//dZmCO9+xNVPCwhFOArMH/AB+YwbFPsMVku2J12Kk96sy/mo=";
Signature signature = Signature.getInstance("SHA256withRSA");
signature.initVerify(KeyFactory.getInstance("RSA").generatePublic(new X509EncodedKeySpec(Base64.getDecoder().decode(PUBLIC_KEY))));
signature.update(param.getBytes());
boolean result = signature.verify(Base64.getDecoder().decode(sign));
System.out.println(result);
}
}
result 的值:
true