Check Which GPG Slots Are In Use

Is it possible to use onlykey-cli to output which GPG key slots are used?

– bvs

No, but there is not a direct command. You can set key labels to describe the keys in each slot manually when setting them. You can also tell if a key is in a slot with this command:

onlykey-agent identity@myhost -sk ECC2

If a public key is returned a key is set in the slot, if not an error stating no key is set is returned.

In newer versions this causes and error invalid int value so it looks like ECC is the default and only the slot number is needed as;

onlykey-agent identity@myhost -sk 2

Unless RSA is used then I guess the -e flag is needed.

– bvs

On reflection this doesn’t work properly. Seems buggy.

As above, if I provide a slot (say 0) I get the pub key then other times I get Public key curve does not match requested type. I can also provide another slot and sometimes I get the same pub key returned as in slot 0 and other times I get the error.

– bvs

The syntax has changed so the key name is used (RSA2) instead of number (2). The command would be:

onlykey-agent user@host -e rsa -sk RSA2
1 Like

Sorry, I don’t understand your response.

To recap, I have an ECC key and this doesn’t work:

The error is invalid int value.

– bvs

OK, pulled the latest onlykey-agent and this works now. I obviously wasn’t getting these latest syntax changes.

– bvs