Unbrauchbarer geheimer Schlüssel

Moin moin,

ich habe hier zwei Starter Keys und wollte meinen GPG Key mal um weitere Identitäten erweitern. Also habe ich die Sicherung meines Keys importiert und die Identitäten erweitern. Nun wollte ich dieses geupdateten Key auf den zweiten Nictrokey Start packen, was aber leider wie folgt endetete:

[yosijo@vash ~]$ gpg --edit-key --expert B2D132C95BB3C2C58AA5B4C30F37DA6A521283F9
gpg (GnuPG) 2.2.17; Copyright (C) 2019 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Geheimer Schlüssel ist vorhanden.

sec  ed25519/0F37DA6A521283F9
     erzeugt: 2019-06-11  verfällt: niemals     Nutzung: SC  
     Kartennummer:FFFE 43212310
     Vertrauen: ultimativ     Gültigkeit: ultimativ
ssb  cv25519/89FA17C32F745144
     erzeugt: 2019-06-11  verfällt: niemals     Nutzung: E   
     Kartennummer:FFFE 43212310
ssb  ed25519/8A1F78B8F553AEE3
     erzeugt: 2019-06-11  verfällt: niemals     Nutzung: A   
     Kartennummer:FFFE 43212310
[ ultimativ ] (1). York-Simon Johannsen (Nitrokey) <info@yosijo.de>
[ ultimativ ] (2)  York-Simon Johannsen (yosijo@computertruhe.de) <yosijo@computertruhe.de>
[ ultimativ ] (3)  York-Simon Johannsen (york-simon.johannsen@computertruhe.de) <york-       simon.johannsen@computertruhe.de>
[ ultimativ ] (4)  York-Simon Johannsen (GitLab) <gitlab@yosijo.de>

gpg> keytocard
Den Hauptschlüssel wirklich verschieben? (j/N) j
Wählen Sie den Speicherort für den Schlüssel:
   (1) Signatur-Schlüssel
   (3) Authentisierungs-Schlüssel
Ihre Auswahl? 1
gpg: Das KEYTOCARD Kommando schlug fehl: Unbrauchbarer geheimer Schlüssel

Sind hier die mehreren Identitäten das Problem oder kann es noch an etwas anderem liegen?

Gruß, York

Vielleicht muss zuvor auf dem zweiten Nitrokey die drei Keyslots in den passenden Algorithmen eingestelkt werden? Dazu “gpg --card-edit” und dann “admin” und “key-attr”.

Hi!

I think identities are part of the public key only, so it should not make a difference for the device. The updated public key should be distributed to the key servers and/or recipients of the GPG emails. So for this case there is no need to update the NK Start.

About the keytocard error message, I suspect you have imported the private part of the encryption key only (this is the only key that is being backed up during the on-device key generation, which is a feature; GnuPG might be more verbose on that though), which would result in inability to modify the main key, hence the message about current secret being useless.

(Please correct me, if I am wrong.)

In case one would like to have a complete key backup to manage it further, it requires a on-PC generation of the key, and then moving it to the device with the key-to-card command. The local encrypted backup should be then moved to a safe storage. Whole process has to be done within a high-security environment (e.g. air-gapped PC, no hard drive, OS run from immutable source like DVD).

I think szszszsz your points are not false.
But can’t I just change the email address every time and export the publickey every time and have some publickeys for different emails without betraying the others?

Since it is my first key and I am still testing a lot, I just wanted to have a backup for it.
I will test if I can change the publickey with a key created on the stick.

jan: Auch mit dem Umstellen blieb das Ergebnis das gleiche. :frowning:

As szszszsz pointed out, the device isn’t aware of the identities. Therefore if your device is equipped with the correct private key already (no matter which identities), you won’t need to update it. Or does your second device not contain the key already?

Wie hast du die keys erstellt? Das ist hier tatsächlich die einzig interessante Frage für den Import. Wie @szszszsz bereits geschrieben hat, kannst du den key nicht importieren, wenn der key on-device erstellt wurde. Bitte siehe hierzu die Anleitung.

Den public key hast du am besten zentral auf einem key server, wenn du den oft ändern möchtest. Der public key (zumindest der part, über den wir hier reden) ist nicht auf dem Gerät. Wenn du unterschiedliche Versionen des öffentlichen Schlüssels in der Welt hast, ist das kein Weltuntergang, aber schöner ist es natürlich, wenn alle Gesprächspartner*innen den aktuellen Schlüssel haben. Dafür gibt es key server.

@nitroalex Ich habe den Key damals auf einem System erstellt und dann auf den Stick übertragen. Geachtet habe ich dabei drauf, das ich curve25519 nutzte. Das System habe ich danach abgeschaltet und gesichert. Nun wollte ich den Key Updaten und habe auf diesem System den Key wieder aus der Sicherung Import und Versucht diesen nach änderungen an den Identitäten wieder auf den Stick zu übertragen.
Das scheint aber so nicht vorgesehen und ich habe nun auf einem neuem Stick einfach einen neuen Erstellt und dieses mal bin ich nach dieser Anleitung vorgegangen. Was dann auch ohne Probleme geklappt hat.

@szszszsz Yes, i can edit the public key and change my ident. Now have in 4 ident pub key files whith only one e-mail from me.