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?