java.lang.Object
org.codehaus.plexus.components.secdispatcher.PinEntry

public class PinEntry extends Object
Inspired by A peek inside pinentry. Also look at Pinentry Documentation. Finally, source mirror is at gpg/pinentry.
  • Constructor Details

    • PinEntry

      public PinEntry(String cmd)
      Creates pin entry instance that will use the passed in cmd executable.
  • Method Details

    • setKeyInfo

      public PinEntry setKeyInfo(String keyInfo)
      Sets a "stable key handle" for caching purposes. Optional.
    • setOk

      public PinEntry setOk(String msg)
      Sets the OK button label, by default "Ok".
    • setCancel

      public PinEntry setCancel(String msg)
      Sets the CANCEL button label, by default "Cancel".
    • setTitle

      public PinEntry setTitle(String title)
      Sets the window title.
    • setDescription

      public PinEntry setDescription(String desc)
      Sets additional test in window.
    • setPrompt

      public PinEntry setPrompt(String prompt)
      Sets the prompt.
    • setError

      public PinEntry setError(String error)
      If set, window will show "Error: xxx", usable for second attempt (ie "bad password").
    • confirmPin

      public PinEntry confirmPin()
      Usable with getPin(), window will contain two input fields and will force user to type in same input in both fields, ie to "confirm" the pin.
    • setTimeout

      public PinEntry setTimeout(Duration timeout)
      Sets the window timeout, if no button pressed and timeout passes, Result will by PinEntry.Outcome.TIMEOUT.
    • getPin

      public PinEntry.Result getPin() throws IOException
      Initiates a "get pin" dialogue with input field(s) using previously set options.
      Throws:
      IOException
    • confirm

      public PinEntry.Result confirm() throws IOException
      Initiates a "confirmation" dialogue (no input) using previously set options.
      Throws:
      IOException
    • message

      public PinEntry.Result message() throws IOException
      Initiates a "message" dialogue (no input) using previously set options.
      Throws:
      IOException
    • main

      public static void main(String[] args) throws IOException
      Throws:
      IOException