Skip to content

More flexible PIN entry #28

@LouisBrunner

Description

@LouisBrunner

Hi @paultag, thanks a lot for this nice library!

In our current project, we sometimes use your package in an automated fashion and inject PIN/Management Key through the Options struct and that works perfectly.

However we also have a CLI/interactive tool where we prompt users for PIN entry. We only want to prompt when the PIN is required, so we can't set all the PIN, PUK, Management Key at start up. In such case it's a bit more difficult to integrate, we currently Close and New the card every-time so we can pass new options with new PINs, messy.

I am fine implementing a way to allow to request PIN entry more dynamically, but I'd like your opinion first on how this should look like.

I see several options:

  • Take an interface as argument in New so we can replace GetPIN, GetPUK, etc and do all our PIN entry logic there, most people could still use the normal Options as before so it is fully backward compatible
  • Ability to pass a *Options to New so we can change PIN, PUK, etc without having to recreate the whole key (not backward compatible and still fairly messy as we have to guess when you need the PIN, etc)
  • Some other options I have missed?

Looking forward to your feedback!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions