Skip to main content

Appendix 2

Signature Generation


  • Signature generation will be using “SHA256WithRSA” algorithm.
  • Partner to generate the digital signature of the message, for example the message in below:
{
"message":{
"TxnType":"510",
"SndrID":"FNXSMYNX",
"SndrIDType":"2",
"RcvrBIC":"RPPEMYKL",
"SndrRefNO":"FNXS00000001,
"SndrLocalTxntime":"20220505104518",
"SndDevicetype":"01",
"SndrDeviceVer":"1.0.35",
"CatPurp":"CASH",
"CurrCode":"MYR",
"Txnamt":1000.00,
"CdtrAgtBIC":"PBBEMYKL",
"CdtrAcct ":"73534278991",
"CdtrAcctType":"SVGS",
"RcptRef": "20201102REF0001",
"PymtDesc" :"Transfer via account"
"IPAddr":"192.0.0.1"
},
"signature":""
}
  • Sample code in (Java):
String data = <retrieve the “message” value from the JSON data>
Signature signature = Signature.getInstance("SHA256withRSA");
signature.initSign(privateKey);
byte[] dataInBytes = data.getBytes();
signature.update(dataInBytes);
byte[] signedInfo = signature.sign();

// Covert the signature into Base64 format
String base64SignedInfo = new
String(Base64.getEncoder().encode(signedInfo));
  • Generate the JSON message with signature generated and send to FINEXUS Retail Payment Gateway.
{
"message": {
"TxnType":"510",
"SndrID":"FNXSMYNX",
"SndrIDType":"2",
"RcvrBIC":"RPPEMYKL",
"SndrRefNo":"FNXS00000001",
"SndrLocalTxnTime":"20220505104518",
"SndrDeviceType":"01",
"SndrDeviceVer":"1.0.35",
"CatPurp":"CASH",
"CurrCode":"MYR",
"TxnAmt":1000.00,
"CdtrAgtBIC":"PBBEMYKL",
"CdtrAcct":"73534278991",
"CdtrAcctType":"SVGS",
"RcptRef":"20201102REF0001",
"PymtDesc":"Transfer via account",
"IPAddr":"192.0.0.1"
},
"signature":"mciXO20wtXNvaXnBTqWRNTiqJNKSDZqm2JNTuqxBdUqeRTnhSPcJX/70hF2WIzeS10
NnUSjbNloSdzfIrGZIPSSXduzUcIgQZcVrJnUjOeZ/31fqV5DMk6ZpZsQtFSvUuWzkfEsh+m90Ywu28
ynRV6xjH9bIzonvrTuv2uPxMDi0WgUr0vbNhqRH18AGHnYYKzieMrpkkCEtvybkyzp5s2k3E2FCgZa/
B7zIBVi/iUcTjFeLn7dIr5e3MEFCZV7teopSdX6gYcdAMnf34MIn33JPeH1mP/O2yAUDtCgRMYyWUgh
ohWqZYj191VQUfQDeP8l1Bklol97HDsJJ51+0UQ=="
}