code: def _dearmor_gpg_key(key_asc):
      
      ps = subprocess.Popen(['gpg', '--dearmor'],
                            stdout=subprocess.PIPE,
                            stderr=subprocess.PIPE,
                            stdin=subprocess.PIPE)
      out, err = ps.communicate(input=key_asc)
      # no need to decode output as it is binary (invalid utf-8), only error
      if six.PY3:
          err = err.decode('utf-8')
      if 'gpg: no valid OpenPGP data found.' in err:
          raise GPGKeyError('Invalid GPG key material. Check your network setup'
                            ' (MTU, routing, DNS) and/or proxy server settings'
                            ' as well as destination keyserver status.')
      else:
          return out
docs: Converts a GPG key in the ASCII armor format to the binary format.
  
      :param key_asc: A GPG key in ASCII armor format.
      :type key_asc: (str, bytes)
      :returns: A GPG key in binary format
      :rtype: (str, bytes)
      :raises: GPGKeyError