-
Notifications
You must be signed in to change notification settings - Fork 467
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:espaillato/jPOS
- Loading branch information
Showing
24 changed files
with
593 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
jpos/src/main/java/org/jpos/emv/cryptogram/CPACryptogram.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package org.jpos.emv.cryptogram; | ||
|
||
import org.jpos.security.ARPCMethod; | ||
import org.jpos.security.MKDMethod; | ||
import org.jpos.security.SKDMethod; | ||
|
||
import org.jpos.emv.cryptogram.CryptogramDataBuilder.PaddingMethod; | ||
|
||
/** | ||
* Common Payment Application (CPA) Cryptogram Specification | ||
*/ | ||
public class CPACryptogram implements CryptogramSpec { | ||
|
||
final PaddingMethod paddingMethod = CryptogramDataBuilder.ISO9797Method2; | ||
|
||
@Override | ||
public MKDMethod getMKDMethod() { | ||
return MKDMethod.OPTION_A; | ||
} | ||
|
||
@Override | ||
public SKDMethod getSKDMethod() { | ||
return SKDMethod.EMV_CSKD; | ||
} | ||
|
||
@Override | ||
public ARPCMethod getARPCMethod() { | ||
return ARPCMethod.METHOD_2; | ||
} | ||
|
||
@Override | ||
public CryptogramDataBuilder getDataBuilder() { | ||
return new CVNCPADataBuilder(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
jpos/src/main/java/org/jpos/emv/cryptogram/CVNCPADataBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package org.jpos.emv.cryptogram; | ||
|
||
import org.jpos.emv.IssuerApplicationData; | ||
import org.jpos.tlv.TLVList; | ||
import static org.jpos.emv.cryptogram.CryptogramDataBuilder.minimumSetOfDataElement; | ||
|
||
public class CVNCPADataBuilder implements CryptogramDataBuilder { | ||
|
||
@Override | ||
public String getDefaultARPCRequest(boolean approved) { | ||
return approved ? "3030" : "3031"; | ||
} | ||
|
||
@Override | ||
public String buildARQCRequest(TLVList data, IssuerApplicationData iad) { | ||
StringBuilder sb = new StringBuilder(); | ||
minimumSetOfDataElement(data).stream().forEach(sb::append); | ||
sb.append(iad.toString()); | ||
return sb.toString(); | ||
} | ||
|
||
@Override | ||
public String buildARQCRequest_padded(TLVList data, IssuerApplicationData iad, PaddingMethod paddingMethod) { | ||
return paddingMethod.apply(buildARQCRequest(data, iad)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.