export a secret key in ASCII-armor format:
</p><pre class="programlisting">
gpg -a --export-secret-keys KEYID &gt; secret.key
</pre><p>
  </p><p>
   You need to use <code class="function">dearmor()</code> on these keys before giving them to
   the PGP functions.  Or if you can handle binary data, you can drop
   <code class="literal">-a</code> from the command.
  </p><p>
   For more details see <code class="literal">man gpg</code>,
   <a class="ulink" href="https://www.gnupg.org/gph/en/manual.html" target="