Skip to content

Commit

Permalink
Add verifypin command
Browse files Browse the repository at this point in the history
  • Loading branch information
nomis authored and russss committed Jun 11, 2023
1 parent 4943ba9 commit ce316ba
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions emv/command/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,3 +252,24 @@ def appdata(ctx, app_index):

app_data = card.get_application_data(opts["AFL"])
click.echo(as_table(app_data, title="Application Data", redact=redact))


@cli.command(
help="""[!] Verify PIN.
This will initiate a transaction on the card."""
)
@click.argument("app_index", type=int)
@click.pass_context
def verifypin(ctx, app_index):
pin = ctx.obj.get("pin", None)
if not pin:
click.secho("PIN is required", fg="red")
sys.exit(2)

card = get_reader(ctx.obj["reader"])
apps = card.list_applications()
app = apps[app_index]
card.select_application(app[Tag.ADF_NAME])
card.get_processing_options()
card.verify_pin(pin)
click.echo("PIN Verified")

0 comments on commit ce316ba

Please sign in to comment.