Cannot import private key

Peter C. Dietrich peter.c.dietrich at
Thu Apr 19 12:39:22 CEST 2012

On Wed, 18 Apr 2012 23:13:27 +0200, Scott Armitage  
<mail at> 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  
> created
> the key pair, given the private key a passphrase, and generated a
> revocation certificate for that key. I am now trying to import that  
> private
> 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  
> form
> Version: GnuPG v1.4.9 (MingW32)
> [snip]
> I then take this private key file to a new computer and try to import it
> using
> 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  
> public
> 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.
> Regards,
> -Scott

Dear Scott,

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 mailing list