Skip to content

Commit

Permalink
Use diamonds
Browse files Browse the repository at this point in the history
  • Loading branch information
demsey committed Apr 29, 2019
1 parent 18625b8 commit 5c84325
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions jpos/src/main/java/org/jpos/security/BaseSMAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ public EncryptedPIN generatePIN(String accountNumber, int pinLen)
@Override
public EncryptedPIN generatePIN(String accountNumber, int pinLen, List<String> excludes)
throws SMException {
List<Loggeable> cmdParameters = new ArrayList<Loggeable>();
List<Loggeable> cmdParameters = new ArrayList<>();
cmdParameters.add(new SimpleMsg("parameter", "account number", accountNumber));
cmdParameters.add(new SimpleMsg("parameter", "PIN length", pinLen));
if(excludes != null && !excludes.isEmpty())
Expand All @@ -428,7 +428,7 @@ public EncryptedPIN generatePIN(String accountNumber, int pinLen, List<String> e
@Override
public void printPIN (String accountNo, EncryptedPIN pinUnderKd1, SecureDESKey kd1
,String template, Map<String, String> fields) throws SMException {
List<Loggeable> cmdParameters = new ArrayList<Loggeable>();
List<Loggeable> cmdParameters = new ArrayList<>();
cmdParameters.add(new SimpleMsg("parameter", "account number", accountNo == null ? "" : accountNo));
cmdParameters.add(new SimpleMsg("parameter", "PIN under Key data 1", pinUnderKd1 == null ? "" : pinUnderKd1));
if (kd1!=null)
Expand Down Expand Up @@ -459,7 +459,7 @@ public String calculatePVV(EncryptedPIN pinUnderLMK, SecureDESKey pvkA,
public String calculatePVV(EncryptedPIN pinUnderLMK, SecureDESKey pvkA,
SecureDESKey pvkB, int pvkIdx,
List<String> excludes) throws SMException {
List<Loggeable> cmdParameters = new ArrayList<Loggeable>();
List<Loggeable> cmdParameters = new ArrayList<>();
cmdParameters.add(new SimpleMsg("parameter", "account number", pinUnderLMK.getAccountNumber()));
cmdParameters.add(new SimpleMsg("parameter", "PIN under LMK", pinUnderLMK));
cmdParameters.add(new SimpleMsg("parameter", "PVK-A", pvkA == null ? "" : pvkA));
Expand Down Expand Up @@ -493,7 +493,7 @@ public String calculatePVV(EncryptedPIN pinUnderKd1, SecureDESKey kd1,
public String calculatePVV(EncryptedPIN pinUnderKd1, SecureDESKey kd1,
SecureDESKey pvkA, SecureDESKey pvkB, int pvkIdx,
List<String> excludes) throws SMException {
List<Loggeable> cmdParameters = new ArrayList<Loggeable>();
List<Loggeable> cmdParameters = new ArrayList<>();
cmdParameters.add(new SimpleMsg("parameter", "account number", pinUnderKd1.getAccountNumber()));
cmdParameters.add(new SimpleMsg("parameter", "PIN under Data Key 1", pinUnderKd1));
cmdParameters.add(new SimpleMsg("parameter", "Data Key 1", kd1));
Expand Down Expand Up @@ -556,7 +556,7 @@ public String calculateIBMPINOffset(EncryptedPIN pinUnderLmk, SecureDESKey pvk,
public String calculateIBMPINOffset(EncryptedPIN pinUnderLmk, SecureDESKey pvk,
String decTab, String pinValData, int minPinLen,
List<String> excludes) throws SMException {
List<Loggeable> cmdParameters = new ArrayList<Loggeable>();
List<Loggeable> cmdParameters = new ArrayList<>();
cmdParameters.add(new SimpleMsg("parameter", "account number", pinUnderLmk.getAccountNumber()));
cmdParameters.add(new SimpleMsg("parameter", "PIN under LMK", pinUnderLmk));
cmdParameters.add(new SimpleMsg("parameter", "PVK", pvk));
Expand Down Expand Up @@ -593,7 +593,7 @@ public String calculateIBMPINOffset(EncryptedPIN pinUnderKd1, SecureDESKey kd1,
public String calculateIBMPINOffset(EncryptedPIN pinUnderKd1, SecureDESKey kd1,
SecureDESKey pvk, String decTab, String pinValData, int minPinLen,
List<String> excludes) throws SMException {
List<Loggeable> cmdParameters = new ArrayList<Loggeable>();
List<Loggeable> cmdParameters = new ArrayList<>();
cmdParameters.add(new SimpleMsg("parameter", "account number", pinUnderKd1.getAccountNumber()));
cmdParameters.add(new SimpleMsg("parameter", "PIN under Data Key 1", pinUnderKd1));
cmdParameters.add(new SimpleMsg("parameter", "Data Key 1", kd1));
Expand Down Expand Up @@ -707,7 +707,7 @@ public String calculateCVV(String accountNo, SecureDESKey cvkA, SecureDESKey cvk
public String calculateCAVV(String accountNo, SecureDESKey cvk, String upn,
String authrc, String sfarc) throws SMException {

List<Loggeable> cmdParameters = new ArrayList<Loggeable>();
List<Loggeable> cmdParameters = new ArrayList<>();
cmdParameters.add(new SimpleMsg("parameter", "account number", accountNo));
cmdParameters.add(new SimpleMsg("parameter", "cvk", cvk == null ? "" : cvk));
cmdParameters.add(new SimpleMsg("parameter", "unpredictable number", upn));
Expand Down Expand Up @@ -758,7 +758,7 @@ public boolean verifyCVV(String accountNo , SecureDESKey cvkA, SecureDESKey cvkB
public boolean verifyCAVV(String accountNo, SecureDESKey cvk, String cavv,
String upn, String authrc, String sfarc) throws SMException {

List<Loggeable> cmdParameters = new ArrayList<Loggeable>();
List<Loggeable> cmdParameters = new ArrayList<>();
cmdParameters.add(new SimpleMsg("parameter", "account number", accountNo));
cmdParameters.add(new SimpleMsg("parameter", "cvk", cvk == null ? "" : cvk));
cmdParameters.add(new SimpleMsg("parameter", "cavv", cavv == null ? "" : cavv));
Expand Down Expand Up @@ -990,7 +990,7 @@ public Pair<EncryptedPIN,byte[]> translatePINGenerateSM_MAC(MKDMethod mkdm
,SecureDESKey kd1, SecureDESKey imksmc, SecureDESKey imkac
,byte destinationPINBlockFormat) throws SMException {

List<Loggeable> cmdParameters = new ArrayList<Loggeable>();
List<Loggeable> cmdParameters = new ArrayList<>();
cmdParameters.add(new SimpleMsg("parameter", "mkd method", mkdm));
cmdParameters.add(new SimpleMsg("parameter", "skd method", skdm));
if (padm!=null)
Expand Down Expand Up @@ -1043,7 +1043,7 @@ public Pair<EncryptedPIN,byte[]> translatePINGenerateSM_MAC(MKDMethod mkdm
public byte[] encryptData(CipherMode cipherMode, SecureDESKey kd
,byte[] data, byte[] iv) throws SMException {

List<Loggeable> cmdParameters = new ArrayList<Loggeable>();
List<Loggeable> cmdParameters = new ArrayList<>();
cmdParameters.add(new SimpleMsg("parameter", "Block Cipher Mode", cipherMode));
if(kd != null)
cmdParameters.add(new SimpleMsg("parameter", "Data key", kd));
Expand All @@ -1057,7 +1057,7 @@ public byte[] encryptData(CipherMode cipherMode, SecureDESKey kd
byte[] encData = null;
try {
encData = encryptDataImpl(cipherMode, kd, data, iv);
List<Loggeable> r = new ArrayList<Loggeable>();
List<Loggeable> r = new ArrayList<>();
r.add(new SimpleMsg("result", "Encrypted Data", encData));
if(iv != null)
r.add(new SimpleMsg("result", "Initialization Vector", iv));
Expand Down Expand Up @@ -1085,7 +1085,7 @@ public byte[] encryptData(CipherMode cipherMode, SecureDESKey kd
public byte[] decryptData(CipherMode cipherMode, SecureDESKey kd
,byte[] data, byte[] iv) throws SMException {

List<Loggeable> cmdParameters = new ArrayList<Loggeable>();
List<Loggeable> cmdParameters = new ArrayList<>();
cmdParameters.add(new SimpleMsg("parameter", "Block Cipher Mode", cipherMode));
if(kd != null)
cmdParameters.add(new SimpleMsg("parameter", "Data key", kd));
Expand All @@ -1099,7 +1099,7 @@ public byte[] decryptData(CipherMode cipherMode, SecureDESKey kd
byte[] decData = null;
try {
decData = decryptDataImpl(cipherMode, kd, data, iv);
List<Loggeable> r = new ArrayList<Loggeable>();
List<Loggeable> r = new ArrayList<>();
r.add(new SimpleMsg("result", "Decrypted Data", decData));
if(iv != null)
r.add(new SimpleMsg("result", "Initialization Vector", iv));
Expand Down Expand Up @@ -1178,7 +1178,7 @@ public SecureDESKey translateKeyFromOldLMK (SecureDESKey kd) throws SMException
@Override
public Pair<PublicKey, SecurePrivateKey> generateKeyPair(AlgorithmParameterSpec spec)
throws SMException {
List<Loggeable> cmdParameters = new ArrayList<Loggeable>();
List<Loggeable> cmdParameters = new ArrayList<>();
cmdParameters.add(new SimpleMsg("parameter", "Algorithm Parameter Spec", spec.getClass().getName()));

LogEvent evt = new LogEvent(this, "s-m-operation");
Expand All @@ -1203,7 +1203,7 @@ public Pair<PublicKey, SecurePrivateKey> generateKeyPair(AlgorithmParameterSpec
@Override
public byte[] calculateSignature(MessageDigest hash, SecurePrivateKey privateKey
,byte[] data) throws SMException {
List<Loggeable> cmdParameters = new ArrayList<Loggeable>();
List<Loggeable> cmdParameters = new ArrayList<>();
cmdParameters.add(new SimpleMsg("parameter", "Hash Identifier", hash));
cmdParameters.add(new SimpleMsg("parameter", "Private Key", privateKey));
cmdParameters.add(new SimpleMsg("parameter", "data", data));
Expand Down

0 comments on commit 5c84325

Please sign in to comment.