$ gpg --card-edit
card-edit -> admin -> factory-reset
card-edit -> admin -> key-attr -> [2->1->12345678]^3
card-edit -> admin -> generate -> 0 -> y -> wg-test^3 -> O
If using scdaemon (Fedora), then make sure the line pcsc-shared
is in ~/.gnupg/scdaemon.conf
. This allows other processes to "lock" the card (over USB). Otherwise the PKCS11 tools will not work while the daemon is running.