[SOLVED] Gpg: KEYTOCARD failed: Invalid value

Okay, the # after sec means that the secret key was already taken offline.

Try another approach:

gpg --list-public-keys

It should display your public GPG key. Attempt to delete it:

gpg --delete-key $KEYID

If it successfully deletes, then there is no secret key. If it fails, this error should display:

gpg: there is a secret key for public key “key-ID”!
gpg: use option “–delete-secret-keys” to delete it first.
1 Like

gpg --delete-key $KEYID successfully deleted the public key. So that means there wasn’t a private key?
Then what’s the output of gpg --armor --export-secret-key arvamircea@gmail.com ? What is that “PRIVATE KEY” that it outputs?

1 Like

Try importing it:

gpg --import private.pgp

It should give out some useful information about its fingerprint to compare it against your keyring.

1 Like

EDIT: Not really sure what is saying. But by far my biggest concern is why gpg --armor --export-secret-key arvamircea@gmail.com outputs a private key. There should be one.

1 Like

Okay, try this command:

gpg --delete-secret-key 0x8CCAF633B6859E80

If you successfully delete the secret key, use this command next:

gpg --list-secret-keys

gpg: KEY "0X8CCAF633B6859E80" not found
gpg: 0X8CCAF633B6859E80: delete key failed: Not found

EDIT: Makes no sense :man_shrugging:
EDIT 2: Is ok, I will make a issue on the guide’s GitHub. I am ready to be made a fool. :flushed:

1 Like

Okay, try the fingerprint:

gpg --delete-secret-key D8E70DAC2CB9F4DE272800D58CCAF633B6859E80
1 Like

No luck :frowning:
Watch me get roasted.

1 Like