Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
meta {
name: 1: Customer ASE - Generate ZMK
type: http
seq: 1
}

post {
url: {{hsmEmulatorHost}}/hsm/ase-customer/generate-zmk
body: json
auth: none
}

headers {
Content-Type: application/json
}

body:json {
{}
}

script:post-response {
const body = res.getBody();

if (body?.component1) bru.setEnvVar("zmk_component1", body.component1);
if (body?.component2) bru.setEnvVar("zmk_component2", body.component2);
if (body?.component3) bru.setEnvVar("zmk_component3", body.component3);
if (body?.kcv) bru.setEnvVar("zmk_kcv", body.kcv);
if (body?.tr31Block) bru.setEnvVar("zmk_tr31_lmk_ilf", body.tr31Block);

}

tests {
test("Status code is 200", function() {
expect(res.getStatus()).to.equal(200);
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
meta {
name: 1: Merchant ASE - Generate ZMK
type: http
seq: 5
}

post {
url: {{hsmEmulatorHost}}/hsm/ase-merchant/generate-zmk
body: json
auth: none
}

headers {
Content-Type: application/json
}

body:json {
{}
}

script:post-response {
const body = res.getBody();

if (body?.component1) bru.setEnvVar("zmk_component1", body.component1);
if (body?.component2) bru.setEnvVar("zmk_component2", body.component2);
if (body?.component3) bru.setEnvVar("zmk_component3", body.component3);
if (body?.kcv) bru.setEnvVar("zmk_kcv", body.kcv);
if (body?.tr31Block) bru.setEnvVar("zmk_tr31_lmk_ilf", body.tr31Block);

}

tests {
test("Status code is 200", function() {
expect(res.getStatus()).to.equal(200);
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
meta {
name: 2: Austria Card - Import ZMK
type: http
seq: 2
}

post {
url: {{hsmEmulatorHost}}/hsm/austria-card/import-zmk
body: json
auth: none
}

headers {
Content-Type: application/json
}

body:json {
{
"component1": "{{zmk_component1}}",
"component2": "{{zmk_component2}}",
"component3": "{{zmk_component3}}",
"kcv": "{{zmk_kcv}}"
}
}

script:post-response {
const body = res.getBody();

if (body?.tr31Block) bru.setEnvVar("zmk_tr31_lmk_austria_card", body.tr31Block);

}

tests {
test("Status code is 200", function() {
expect(res.getStatus()).to.equal(200);
});
}
37 changes: 37 additions & 0 deletions bruno/collections/Rafiki/HSM Emulator/2- KaiOS - Import ZMK.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
meta {
name: 2: KaiOS - Import ZMK
type: http
seq: 6
}

post {
url: {{hsmEmulatorHost}}/hsm/kai-os/import-zmk
body: json
auth: none
}

headers {
Content-Type: application/json
}

body:json {
{
"component1": "{{zmk_component1}}",
"component2": "{{zmk_component2}}",
"component3": "{{zmk_component3}}",
"kcv": "{{zmk_kcv}}"
}
}

script:post-response {
const body = res.getBody();

if (body?.tr31Block) bru.setEnvVar("zmk_tr31_lmk_kai", body.tr31Block);

}

tests {
test("Status code is 200", function() {
expect(res.getStatus()).to.equal(200);
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
meta {
name: 3: Customer ASE - Generate Card Keypair
type: http
seq: 3
}

post {
url: {{hsmEmulatorHost}}/hsm/ase-customer/generate-card-key
body: json
auth: none
}

headers {
Content-Type: application/json
}

body:json {
{
"tr31ZmkUnderLmk": "{{zmk_tr31_lmk_ilf}}"
}
}

script:post-response {
const body = res.getBody();

if (body?.tr31CardKeyUnderLmk) bru.setEnvVar("cardkey_tr31_lmk_ilf", body.tr31CardKeyUnderLmk);
if (body?.tr31CardKeyUnderZmk) bru.setEnvVar("cardkey_tr31_zmk", body.tr31CardKeyUnderZmk);
if (body?.publicKey) bru.setEnvVar("cardkey_public", body.publicKey);
if (body?.kcv) bru.setEnvVar("cardkey_kcv", body.kcv);


}

tests {
test("Status code is 200", function() {
expect(res.getStatus()).to.equal(200);
});
}
38 changes: 38 additions & 0 deletions bruno/collections/Rafiki/HSM Emulator/3- KaiOS - Generate TMK.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
meta {
name: 3: KaiOS - Generate TMK
type: http
seq: 7
}

post {
url: {{hsmEmulatorHost}}/hsm/kai-os/generate-tmk
body: json
auth: none
}

headers {
Content-Type: application/json
}

body:json {
{
"terminalSerial": "KAISN0000111",
"zmkUnderLmk": "{{zmk_tr31_lmk_kai}}"
}
}

script:post-response {
const body = res.getBody();

if (body?.tr31TmkUnderLmk) bru.setEnvVar("tmk_tr31_lmk_kai", body.tr31TmkUnderLmk);
if (body?.tr31TmkUnderZmk) bru.setEnvVar("tmk_tr31_zmk", body.tr31TmkUnderZmk);
if (body?.terminalSerial) bru.setEnvVar("tmk_serial", body.terminalSerial);
if (body?.kcv) bru.setEnvVar("tmk_kcv", body.kcv);

}

tests {
test("Status code is 200", function() {
expect(res.getStatus()).to.equal(200);
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
meta {
name: 4: Austria Card - Import Card PrivateKey
type: http
seq: 4
}

post {
url: {{hsmEmulatorHost}}/hsm/austria-card/import-card-key
body: json
auth: none
}

headers {
Content-Type: application/json
}

body:json {
{
"tr31ZmkUnderLmk": "{{zmk_tr31_lmk_austria_card}}",
"tr31CardKeyUnderZmk": "{{cardkey_tr31_zmk}}",
"kcv": "{{cardkey_kcv}}"
}
}

script:post-response {
const body = res.getBody();

if (body?.tr31CardKeyUnderLmk) bru.setEnvVar("cardkey_tr31_lmk_austria_card", body.tr31CardKeyUnderLmk);

}

tests {
test("Status code is 200", function() {
expect(res.getStatus()).to.equal(200);
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
meta {
name: 4: Merchant ASE - Import TMK
type: http
seq: 8
}

post {
url: {{hsmEmulatorHost}}/hsm/ase-merchant/import-tmk
body: json
auth: none
}

headers {
Content-Type: application/json
}

body:json {
{
"tr31TmkUnderZmk": "{{tmk_tr31_zmk}}",
"tr31ZmkUnderLmk": "{{zmk_tr31_lmk_ilf}}",
"kcv": "{{tmk_kcv}}"
}
}

script:post-response {
const body = res.getBody();

if (body?.tr31TmkUnderLmk) bru.setEnvVar("tmk_tr31_lmk_ilf", body.tr31TmkUnderLmk);


}

tests {
test("Status code is 200", function() {
expect(res.getStatus()).to.equal(200);
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
meta {
name: 5: Merchant ASE - Generate BDK
type: http
seq: 9
}

post {
url: {{hsmEmulatorHost}}/hsm/ase-merchant/generate-bdk
body: json
auth: none
}

headers {
Content-Type: application/json
}

body:json {
{
"zmkUnderLmk": "{{zmk_tr31_lmk_ilf}}"
}
}

script:post-response {
const body = res.getBody();

if (body?.tr31BdkUnderLmk) bru.setEnvVar("bdk_tr31_lmk_ilf", body.tr31BdkUnderLmk);
if (body?.tr31BdkUnderZmk) bru.setEnvVar("bdk_tr31_zmk", body.tr31BdkUnderZmk);


}

tests {
test("Status code is 200", function() {
expect(res.getStatus()).to.equal(200);
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
meta {
name: 6: Merchant ASE - Derive IPEK
type: http
seq: 10
}

post {
url: {{hsmEmulatorHost}}/hsm/ase-merchant/derive-ipek
body: json
auth: none
}

headers {
Content-Type: application/json
}

body:json {
{
"tr31BdkUnderLmk": "{{bdk_tr31_lmk_ilf}}",
"tr31TmkUnderLmk": "{{tmk_tr31_lmk_ilf}}",
"ksnHex": "ffff9876543210e00000"
}
}

script:post-response {
const body = res.getBody();

if (body?.tr31IpekUnderLmk) bru.setEnvVar("ipek_tr31_lmk_ilf", body.tr31IpekUnderLmk);
if (body?.tr31IpekUnderTmk) bru.setEnvVar("ipek_tr31_tmk", body.tr31IpekUnderTmk);
if (body?.kcv) bru.setEnvVar("ipek_kcv", body.kcv);


}

tests {
test("Status code is 200", function() {
expect(res.getStatus()).to.equal(200);
});
}
1 change: 1 addition & 0 deletions bruno/collections/Rafiki/environments/Local Playground.bru
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ vars {
assetIdTigerBeetle: 1
assetCode: USD
assetScale: 2
hsmEmulatorHost: http://localhost:5002
senderTenantId: 438fa74a-fa7d-4317-9ced-dde32ece1787
RafikiGraphqlHostTenantId: 438fa74a-fa7d-4317-9ced-dde32ece1787
senderOpenPaymentsPort: 3000
Expand Down
Loading