签证令牌服务(VTS) [英] Visa Token Service (VTS)
问题描述
是否有人通过有效加密方式向Visa令牌服务发送了请求?
Has any body sent the request to Visa token Service with valid encryption?
https://developer.visa.com/products/vts/reference#vts__payment_data
能否要通过XPAY TOKEN生成,请在代码中帮助JWE:
Was able to pass XPAY TOKEN genration, please help in JWE in code:
public static String generateJWE3(PlainPan pan) throws Exception {
Gson gson = new Gson();
String json = gson.toJson(pan);
String sharedSecret = Constants.VTS_SHARED_SECRET;
MessageDigest md = MessageDigest.getInstance("SHA-256");
byte[] digest = md.digest(sharedSecret.getBytes("UTF-8"));
String kid = "gUkXp2s5v8y/A?D(G+KbPeShVmYq3t6w";
KeyGenerator kg = KeyGenerator.getInstance("AES");
kg.init(256);
String encryptionKey = Constants.VTS_API_KEY;
JWEAlgorithm jweAlgorithm = JWEAlgorithm.A256GCMKW;
EncryptionMethod encryptionMethod = EncryptionMethod.A256GCM;
JWEHeader.Builder headerBuilder = new JWEHeader.Builder(jweAlgorithm, encryptionMethod);
headerBuilder.keyID(encryptionKey);
JWEHeader header = headerBuilder.build();
JWEEncrypter encrypter = new AESEncrypter(digest);
encrypter.getJCAContext().setProvider(BouncyCastleProviderSingleton.getInstance());
JWEObject jweObject = new JWEObject(header, new Payload(json));
jweObject.encrypt(encrypter);
String serialized = jweObject.serialize();
JWEObject temp = JWEObject.parse(serialized);
System.out.println("In JWE Header= " + temp.getHeader());
System.out.println("In Enc Key= " + temp.getEncryptedKey());
System.out.println("In IV= " + temp.getIV());
System.out.println("In CT= " + temp.getCipherText());
System.out.println("In AT= " + temp.getAuthTag());
// decrypt(sharedSecret,serialized);
return serialized;
}
{
"errorResponse":{
"status":400,
"message":"Input for encPaymentInstrument is invalid or inconsistent with the profile.",
"reason":"invalidParameter",
"details":[{
"location":"encPaymentInstrument"
}]
}
}
推荐答案
问题是由于无效 encPaymentInstrument
数据请让用户按照以下步骤操作,
The issue is because of the Invalid encPaymentInstrument
data please ask the user to follow the below steps,
步骤进行API调用:
-
创建VTS APP
Create VTS APP
转到已注册的gmail查看电子邮件来自VTS
go to the registered gmail to check the email from VTS
导航到该网址( https://developer.digital.visa.com/self-service-ic )设置密码并创建配置文件,为APPID字段指定的值将为clientAppID
navigate to that URL (https://developer.digital.visa.com/self-service-ic) set password and create a profile, the value given for APPID field will be the "clientAppID"
请使用 nimbus-jose-jwt-4.12.jar
实用程序生成jwe加密。
Please use nimbus-jose-jwt-4.12.jar
utility to generate jwe encryption.
这篇关于签证令牌服务(VTS)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!