Hello,
Please let me know, how to generate RSA 4096 keys on the card without exporting or revealing their private parts to the host and after that get corresponding public keys present in the software keyring of the GPG?
I am using Debian stable.
Created the keys using generate
command INSIDE the card using gpg --card-edit
command, and rejected to export them when was asked.
gpg --card-status
displays everything is like OK, there are three RSA4096 keys inside the card.
Now I try to find them in the software keyring and then export them for usage with SSH.
All suggestions which I was able to find offer to import public keys from somewhere except the card itself, e.g. from key server, from local disk asc file, etc. But I did NOT export any keys during generate
procedure. I would like private parts of the keys would NEVER leave the secure hardware of my NitrokeyPro2.
But where can I get public parts of the keys for local software keyring of the gpg? I tried to gpg --card-status
, but it did not help to populate my software keyring.
Are public parts of the keys stored on the card at all? Or the card hardware stores only private parts of the keys?
Your instruction:
https://docs.nitrokey.com/pro/linux/openpgp-keygen-on-device
suggest: “Please do not create the suggested off-card backup”
This “backup” does only save the encryption key, but not the signature and authentication keys. In case of a loss of the device, you will not be able to restore the whole key set. So on the one hand it is no full backup (use these instructions instead, if you need one) and on the other hand you risk that someone else can get in possession of your encryption key. The advantage of generating keys on-device is to make sure that keys are stored securely. Therefore, we recommend to skip this half-backup.
Also it mentions one of private keys is exported (specifically “encryption key”).
I also tried to make this so called “off-card backup”, and it resulted in what I was looking for: all keys are listed in the software keyring. Though I am not sure private parts for which keys were actually exported if any one of them at all and how to verify this? And how to delete exported private parts of the keys keeping public keys in the ring.
Also please explain what is being stored in the directory:
~/.gnupg/private-keys-v1.d
There is a string like shadowed private key and such files are being created even if choosing to avoid making off card backup for the keys.
Are these actual private keys the same as on the secure card hardware, or something else? I would like no private keys used for SSH authentication ever leave the Nitrokey Pro2.
Actually I am already confused with all this mess. Can NitrokeyPro2 be used just as PKCS11 provider for SSH without any GPG and private keys shall never leave the token ever.
How many PKCS11 RSA4096 keys can be created in PKCS11 mode for SSH without using any GPG related tools?
Where is an instruction for NitrokeyPro2 (generating not extractable PKCS11 private keys, then use them in ssh -I
, etc.) +PKCS11+SSH ? The same way as eToken, HSM, etc. work if I understand correctly. No GPG please
Thanks