Skip to content

Starting with switstack moka 🍴

Playing with the code

Info

switstack moka options are:

-h:         displays help
-c:         specifies virtual card
-f:         specifies config
-t:         specifies trd
-k:         specifies cakeys
-r:         specifies revocations
-v:         displays version

Virtual terminal

This mode can be used to replay transactions based on APDU logs.

Warning

If you use switstack transaction examples, set following TRD tags as followed: 9f 37 04 de ad be ef 9a 03 23 08 01

Other tags depend on the transactions variable imposed by test plans.

Steps Description Command
#1 Contact switstack to open a github account (see switstack). n/a
#2 Clone the repository. git clone repository_reference
#3 Make the build for virtual mode. cmake -B build -S . -D CMAKE_BUILD_TYPE=Debug -D CMAKE_TOOLCHAIN_FILE=./external/cmake-toolchains/cmake/toolchains/gcc_linux-x86_64.toolchain.cmake -D MOKA_BUILD_TESTS=ON -D MOKA_BUILD_TEST_APP=ON -D MOKA_TRACE_CERTIF=ON -D MOKA_HAL=VEP-L -DSWITSTACK_VERSION="1.0.0"
#4 Compile the code. cmake --build ./build
#5 Perform unit test. ./build/test/moka_test
#6 Execute the code. ./build/apps/moka/moka -f mchip1.txt -t trd_00_15_00.txt -k mastercard.txt -r mastercard.txt -c card_name.txt

PCSC-based terminal

This mode can be used for qualification with accredited tools, and with actual card.

Warning

Actual cards coming from production (your card 😃) use specific certificates that are not provided by switstack.

Steps Description Command
#1 Contact switstack to open a github account (see switstack). n/a
#2 Clone the repository. git clone repository_reference
#3 Make the build for PCSC mode. cmake -B build -S . -D CMAKE_BUILD_TYPE=Debug -D CMAKE_TOOLCHAIN_FILE=./external/cmake-toolchains/cmake/toolchains/gcc_linux-x86_64.toolchain.cmake -D MOKA_BUILD_TESTS=ON -D MOKA_BUILD_TEST_APP=ON -D MOKA_TRACE_CERTIF=ON -D MOKA_HAL=PCSC -DSWITSTACK_VERSION="1.0.0" -DMOKA_MASTERCARD_MAGSTRIPE=OFF
#4 Compile the code. cmake --build ./build
#5 Execute the code. ./build/apps/moka/moka -f mchip1.txt -t trd_00_15_00.txt -k mastercard.txt -r mastercard.txt