I have just moved NKPro to another computer and could recreate the stubs on the target machine, but I only managed to do that using gpg, not gpg2. Your specific question how to recreate the subkey stubs is answered in
Quote:
“Towards that end, you may first import the master key’s public key (e.g., from a USB stick); afterwards, execute gpg --card-status or gpg --card-edit with inserted card, which constructs the stubs for the secret subkeys in the keyring.”
Afterwards you should remove the masterkey from your keyring again, leaving only the subkey stubs in secring.gpg.
In fact, in order to be able to do that you should follow/have been following the FSFE’s HowTo from the beginning. I am not sure if you did that.
As to my problem, that gpg2 (2.0.19) does not even successfully establish connection (via gpg-agent) with the Nitrokey, do you think that there is any other solution than the one you mention (publish the key first on keyserver). I have followed the NKPro Install instructions setting up the device on another computer (following the FSFE’s guide) and moving it to my target machine with gpg 2.0.19, where all required packages are installed (I am not using the app, though, just gpg, opensc, pcscd, i.e. have performed all steps required by NK Pro Install doc).
firstly my tests show that GPG 2.0 has issues talking to Nitrokey Pro (and HSM).
Upgrading to GPG 2.1.10 solved these issues for me.
Please be aware of older gpg-agent instances which need to be killed!
There is definitely no need to remove the master key from secring.gpg as the secret master key is not imported anyway.
(In my setup the secret master key is kept on a specially secured offline system idependent of Nitrokey)
My workaround for remebering the ID of the masterkey which is required to download the needed public master key from the keyserver is to abuse the “URL of public key” and not use the fetch command but parse the value from --card-status and then execute the gpg --keyserver command.