I'm trying to decrypt a file that was signed with my ssb key stored on my Yubikey, but I get the following errors:
x>gpg -vv --decrypt encrypted.gpg
gpg: armor: BEGIN PGP MESSAGE
# off=0 ctb=XX tag=1 hlen=3 plen=XXX
:pubkey enc packet: version 3, algo 1, keyid XXXX5753679AAAAA
data: [4096 bits]
gpg: public key is XXXX5753679AAAAA
# off=XXX ctb=XX tag=1 hlen=3 plen=XXX
:pubkey enc packet: version 3, algo 1, keyid XXXX05D83EFAAAAA
data: [4096 bits]
gpg: public key is XXXX05D83EFAAAAA
gpg: using subkey XXXX05D83EFAAAAA instead of primary key XXXXXXXXXXXXXXXX
# off=XXXX ctb=XX tag=XX hlen=2 plen=0 partial new-ctb
:encrypted data packet:
length: unknown
mdc_method: 2
gpg: using subkey XXXX05D83EFAAAAA instead of primary key XXXXXXXXXXXXXXXX
gpg: encrypted with 4096-bit RSA key, ID XXXX05D83EFAAAAA, created 2018-XX-XX
"x (Personal Key) <[email protected]>"
gpg: public key decryption failed: Invalid ID
gpg: using subkey XXXX5753679AAAAA instead of primary key XXXXXXXXXXXXXXXX
gpg: encrypted with 4096-bit RSA key, ID XXXX5753679AAAAA, created 2018-XX-XX
"y <[email protected]>"
gpg: decryption failed: No secret key
To make sure my smartcard was being detected, I ran gpg --card-status, which worked, and I saw the same ID in the output. Anyone know why I can't decrypt using my yubikey? Thanks.
Also, I ran gpg --list-secret-keys:
x>gpg --list-secret-keys
C:/Users/x/AppData/Roaming/gnupg/pubring.kbx
--------------------------------------------------
sec> rsa4096 2018-xx-xx [SC] [expires: 2019-xx-xx]
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Card serial no. = 000X 0XXXXXXX
uid [ultimate] x (Personal Key) <[email protected]>
ssb> rsa4096 2018-xx-xx [E] [expires: 2019-xx-xx]
ssb> rsa4096 2018-xx-xx [SEA] [expires: 2019-xx-xx]
The thing is, I don't have the second secret key, only the first. The issue seems to be "public key decryption failed: Invalid ID" (the secret key of this public key is on my smartcard).
--card-status
looked fine but the key handle wouldn't update until I deleted it outright and checked the card again.