gpg: decryption failed: No secret key

Yu 999iscool at gmail.com
Wed Aug 8 06:03:48 CEST 2018


WOW! That works.

To document this, if anyone ever run into this situation:

> sec#  rsa4096/0xC9E7221DAFCE6539  created: 2018-08-07  expires: never
This is the key I need to delete from the card/yubikey.

1. gpg --delete-key 0xC9E7221DAFCE6539

2. gpg --card-status should return NONE and  gpg --list-keys would return
gpg: no ultimately trusted keys found

3. pull out the card

4. run gpg --import PUBLIC_KEY_FILE

5. insert the card

6. gpg --card-status

7. now try to encrypt and decrypt (you will be prompted to enter your PIN
to unlock your card).

Thank you Dirk!

On Tue, Aug 7, 2018 at 7:59 PM Dirk Gottschalk <
dirk.gottschalk1980 at googlemail.com> wrote:

> Hi.
>
> Am Dienstag, den 07.08.2018, 19:38 -0400 schrieb Yu:
> > Hi Dirk
>
> > Thank you very much. I just want to make sure I am doing the right
> > thing,
> > so please excuse me if I am asking too much.
>
> > > You should delete the complete secret key set from you keyring.
> > Then
> > > import the PUBLIC keys for the card keys and then do a gpg --card-
> > > status.
> > >
> > >
> >
> > Do I just call "gpg delete-secret-key ID" for each key ID listed in
> > the
> > --list-secret-keys output?
>
> You have just to delete the keys, which are stored on the card.
> Deleteing the master key of them also deletes the sub keys.
>
>
> > > If you set a fetch URL, you could also make --card-edit and issue a
> > > fetch command.
> > >
> >
> > I have not :/
>
> That's no problem at all. Then you have to imnport the public key of
> the card key BEFORE you insert the card and make --card-status. Only
> then the card is recognised and the stubs are generated automatically.
>
> If the public keys are not in your public keyring, the card keys are
> ignored.
>
> Regards,
> Dirk
>
> --
> Dirk Gottschalk
> Paulusstrasse 6-8
> 52064 Aachen, Germany
>
> GPG: DDCB AF8E 0132 AA54 20AB  B864 4081 0B18 1ED8 E838
> Keybase.io: https://keybase.io/dgottschalk
> GitHub: https://github.com/Dirk1980ac
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnupg-users/attachments/20180808/02833008/attachment-0001.html>


More information about the Gnupg-users mailing list