Python und PGP

Oetzicool

Erfahrenes Mitglied
Hey Leute, ich will ein kleines Python Skript schreiben, welches einen Text nimmt eine digitale Signatur dranhängt und diese dann weiterleitet. Des weiterleiten ist kein Problem aber ich habe enorme Probleme eine digitale Signatur zu erstellen. Ich hab schon mehrere Pythonbibliotheken angeschaut und z.B. mit pyme auch schon etwas gebastelt
Code:
import pyme.core as pc
import pyme.pygpgme as pp

plain = pc.Data('this is a test message')
cipher = pc.Data()
ctx = pc.Context()
ctx.set_armor(1)
name = 'me@office.com'
ctx.op_keylist_start(name,0)
key = ctx.op_keylist_next()
ctx.op_sign(plain,cipher, pp.GPGME_SIG_MODE_DETACH)
cipher.seek(0,0)
print plain.read()
print cipher.read()

Des Problem ist er gibt mir nichts aus, nun wollte ich Fragen ob schon jemand anders so etwas realisiert hat, meinetwegen auch mit einer anderen Bibliothek , das ist das ergebnis wo ich hinwill:
Code:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

this is a test message

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Weitere Infos: siehe http://www.gnupg.org
iD8DBQE98JUp3cgYmKmkyoYRAmhaAKCNi8C4nJeWSdoye4B1Cs1iuxpdoA
CZASa9
/stKyMXPB/4/kRIzhmdKq/8=
=o/KA
-----END PGP SIGNATURE-----

Ich hoffe mir kann einer helfen, danke schonmal :D
 
Zurück