Skip to content
This repository was archived by the owner on Mar 27, 2026. It is now read-only.

Commit ce316ba

Browse files
nomisrussss
authored andcommitted
Add verifypin command
1 parent 4943ba9 commit ce316ba

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

emv/command/client.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,3 +252,24 @@ def appdata(ctx, app_index):
252252

253253
app_data = card.get_application_data(opts["AFL"])
254254
click.echo(as_table(app_data, title="Application Data", redact=redact))
255+
256+
257+
@cli.command(
258+
help="""[!] Verify PIN.
259+
This will initiate a transaction on the card."""
260+
)
261+
@click.argument("app_index", type=int)
262+
@click.pass_context
263+
def verifypin(ctx, app_index):
264+
pin = ctx.obj.get("pin", None)
265+
if not pin:
266+
click.secho("PIN is required", fg="red")
267+
sys.exit(2)
268+
269+
card = get_reader(ctx.obj["reader"])
270+
apps = card.list_applications()
271+
app = apps[app_index]
272+
card.select_application(app[Tag.ADF_NAME])
273+
card.get_processing_options()
274+
card.verify_pin(pin)
275+
click.echo("PIN Verified")

0 commit comments

Comments
 (0)