Yubico Forum
https://forum.yubico.com/

[QUESTION] - How to resolve gpg: card is permanently locked!
https://forum.yubico.com/viewtopic.php?f=35&t=2608
Page 1 of 1

Author:  MrD [ Wed Mar 22, 2017 3:37 pm ]
Post subject:  [QUESTION] - How to resolve gpg: card is permanently locked!

I received a brand-new Yubikey 4 and wanted to copy an existing OpenPGP key onto it for testing purposes. During the process, I had several issues with russing gpg-agent and such, so I was unsure which password to enter at which time. I worked according to this How To.

However, I ended up with gpg: card is permanently locked! as in:
Code:
me@desktop ~ $ gpg --card-edit

can't connect to `/home/me/.gnupg/S.gpg-agent': No such file or directory
Application ID ...: D276xxx
Version ..........: 2.1
Manufacturer .....: unknown
Serial number ....: 0xxxx
Name of cardholder: [not set]
Language prefs ...: [not set]
Sex ..............: unspecified
URL of public key : [not set]
Login data .......: [not set]
Private DO 1 .....: [not set]
Private DO 2 .....: [not set]
Signature PIN ....: not forced
Key attributes ...: 2048R 2048R 2048R
Max. PIN lengths .: 127 127 127
PIN retry counter : 3 0 0
Signature counter : 0
Signature key ....: [none]
Encryption key....: [none]
Authentication key: [none]
General key info..: [none]

gpg/card> admin
Admin commands are allowed

gpg/card> url
URL to retrieve public key: http://www....
gpg: card is permanently locked!
gpg: error setting URL: bad passphrase


I get a similar error message when trying to move a private key onto the Yubikey 4:
Code:
gpg> keytocard
Please select where to store the key:
   (2) Encryption key
Your selection? 2
gpg: KEYTOCARD failed: Bad secret key


I found some explanations on how to reset the NEO, but I don't think that the mentioned reset mechanisms work with the Yubikey 4 as well.

How can I resolve this issue?

Author:  ChrisHalos [ Wed Mar 22, 2017 6:01 pm ]
Post subject:  Re: [QUESTION] - How to resolve gpg: card is permanently loc

Covered on our website:

http://www.homedepot.com/p/Suncast-Trem ... /204725195

Our developers website:

https://developers.yubico.com/ykneo-ope ... pplet.html

On the forum:

viewtopic.php?f=26&t=2182
viewtopic.php?f=35&t=2193

Only difference in OpenPGP reset between YubiKey NEO and YubiKey 4 is the replies you get from PGP connect agent which confirm each PIN has been locked out successfully and the card has been terminated.

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/