'>>> g = GnuPG(None)
>>> s = g.sign("Hello, World", _from="smari@mailpile.is",
clearsign=True)[1]
>>> g.verify(s)'

def verify(self, data, signature=None):

    params = ['--verify']
    if signature:
        sig = tempfile.NamedTemporaryFile()
        sig.write(signature)
        sig.flush()
        params.append(sig.name)
        params.append('-')
    self.event.running_gpg((_('Checking    signature    in    %d    bytes    of    data') % len(data)))
    (ret, retvals) = self.run(params, gpg_input=data, partial_read_ok=True)
    return GnuPGResultParser().parse([None, retvals]).signature_info
