+-----------------------------------------------------------------------
| Running ${FULLPKGNAME} on OpenBSD
+-----------------------------------------------------------------------

Granting access to users
========================
The user running nitrocli needs the necessary privileges to access
the device. You may need to change the permissions of the corresponding
usb(4) , uhid(4) and ugen(4) controllers as a result.

You may identify the usb(4) device the NitroKey is attached to with
usbdevs(8):

$ usbdevs | grep -e /dev/usb -e Nitrokey
Controller /dev/usb0:
Controller /dev/usb1:
addr 03: 20a0:4109 Nitrokey, Nitrokey Storage
Controller /dev/usb2:

The corresponding uhid(4) and ugen(4) devices can be obtained from the
output of dmesg(8):

$ dmesg
[...]
uhidev3 at uhub3 port 1 configuration 1 interface 2 \
"Nitrokey Nitrokey Storage" rev 2.00/1.01 addr 3
uhidev3: iclass 3/0
uhid1 at uhidev3: input=64, output=64, feature=64
ugen0 at uhub3 port 1 configuration 1 "Nitrokey Nitrokey Storage" \
rev 2.00/1.01 addr 3

You may then use chgrp(1) and chmod(8) to grant access to the Nitrokey.
For example, in order to allow users from the wheel group to use the
Nitrokey in the example above, you would issue commands such as:

# chgrp wheel /dev/usb1 /dev/ugen0.* /dev/uhid1
# chmod 660 /dev/usb1 /dev/ugen0.* /dev/uhid1

Interaction with gpg-agent
==========================
A working gpg-agent is required for a number of operations. You may
need to add the following line to your $HOME/.profile in order to
ensure the agent is invoked properly:

export GPG_TTY=$(tty)

There is a known bug in libnitrokey that may cause the NitroKey to hang
if a smartcard operation is performed and a libnitrokey operation is
attempted immediately afterwards. The implication is that if you use a
NitroKey for decrypting or signing via gpg, you will need to restart the
gpg-agent with:

gpgconf --kill gpg-agent

Shell Autocompletion
====================
Upstream nitrocli ships with an utility for generating autocompletion
configurations for many popular shells. You may invoke
nitrocli-shell-complete and use its output to configure your shell if
you want autocompletion.
