arekinath / pivy

Tools for using PIV tokens (like Yubikeys) as an SSH agent, for encrypting data at rest, and more
193 stars 26 forks source link

Accept Environment variable PIV_PIN #21

Closed manonfgoo closed 1 year ago

manonfgoo commented 4 years ago

If Environment variable PIV_PIN is set, the PIN is read from the environment rather then Prompting the user.

On macOS this would allow us to: $ export PIV_PIN=$( /usr/bin/osascript -e 'Tell application "System Events" to display dialog "Enter PIN:" with hidden answer default answer ""' -e 'text returned of result') $ cat $KEYFILE | pivy-box key unlock testme2
$ unset PIV_PIN