Trouble importing secret subkeys

Mikael "MMN-o" Nordfeldth mmn at hethane.se
Tue Mar 25 17:18:06 CET 2014


On 2014-03-25 16:08, Daniel Kahn Gillmor wrote:
> On 03/25/2014 10:27 AM, Mikael "MMN-o" Nordfeldth wrote:
>> If this lack of UID in the list is related, how can I include my primary
>> UID with the export? Why is it excluded at all?
>
> [...]
>
> i'd use gpgsplit on your two separate files to break out the distinct
> packets, and then use cat to combine the uid and self-sig packets from
> the pubkeys file with the secrets from the subkeys file, feeding the
> result into gpg --import.

Great, thank you! gpgsplit let me export and thus rebuild the packages
into a functioning state for my master and subkey keypairs.

> mkdir pubpackets subpackets
> (cd pubpackets && gpgsplit < ../pubkeys)
> (cd subpackets && gpgsplit < ../subkeys)
>
> cat subpackets/000001-005.secret_key \
>     pubpackets/000002-013.user_id \
>     pubpackets/000003-002.sig \
>     subpackets/000002-007.secret_subkey \
>     subpackets/000003-002.sig \
>     subpackets/000004-007.secret_subkey \
>     subpackets/000005-002.sig \
>  | gpg --import

I tried that and then modified the command a little bit (because I
figured I maybe can rebuild the entire keyrings):

I started, as in your example, with subpackets/000001-006.public_key and
then followed with just about all of the other packet-files:
   * I had to exclude pubpackets/000001-006.public_key because it caused
gpg to output the "no user ID" error.
   * I also excluded the pubpackets/0000*-014.public_subkey files and
their respective .sig files, because `gpg -K` then listed 'ssb' AND
'sub' entries, instead of just 'ssb' which I'm used to.

So now I have all the desired parts of my public and master keys, from
which I have been able export relevant secret subkeys to other machines
without running into the "no user ID" error message.

Thanks again Daniel!

-- 
Mikael "MMN-o" Nordfeldth
XMPP/mail: mmn at hethane.se
http://blog.mmn-o.se/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: </pipermail/attachments/20140325/38c37b07/attachment.sig>


More information about the Gnupg-users mailing list