Cannot import private key
Peter C. Dietrich
peter.c.dietrich at freenet.de
Thu Apr 19 12:39:22 CEST 2012
On Wed, 18 Apr 2012 23:13:27 +0200, Scott Armitage
<mail at scott.armitage.name> wrote:
> Hi everyone,
> I am trying to integrate GnuPG with my workflow, and am in the stage of
> setting up a new keypair for use across all of my computers. I have
> the key pair, given the private key a passphrase, and generated a
> revocation certificate for that key. I am now trying to import that
> key on another computer, but I am having some issues.
> I first export the private key using:
> gpg --export-secret-key -a <key_id> > private.asc
> This seems to work fine, and generates an ASCII-armored key file of the
> -----BEGIN PGP PRIVATE KEY BLOCK-----
> Version: GnuPG v1.4.9 (MingW32)
> -----END PGP PRIVATE KEY BLOCK-----
> I then take this private key file to a new computer and try to import it
> gpg --import private.asc
> gpg: no valid OpenPGP data found.
> gpg: Total number processed: 0
> Any suggestions? This process works fine for exporting and importing
> keys, it's only the private one that is throwing this error. I have also
> tried the --allow-secret-key-import, though I understand this is
> effectively redundant now.
I think you should try to export the private key unarmored, i.e. leave out
the -a option. This should work.
More information about the Gnupg-users