M2Crypto SMIME Mail verification error in Outlook and Thunderbird
Patrick Hagelkruys <[email protected]>
| Newsgroups | gmane.comp.python.cryptography |
|---|---|
| Message-ID | <LISTSERV%[email protected]> |
I tried to digital sign a message with m2crypto and verify it with Outloo
k.
But Outlook (also Thunderbird) failed to verify the signature, because th
e
digital signature of the message is invalid.
my code:
buf = BIO.MemoryBuffer (msg)
s = SMIME.SMIME()
s.load_key(from_key, from_cert)
p7 = s.sign(buf,SMIME.PKCS7_TEXT)
buf = BIO.MemoryBuffer (msg)
out = BIO.MemoryBuffer()
out.write('From: %s\r\n' % from_addr)
out.write('To: %s\r\n' % to_addr)
out.write('Subject: %s\r\n' % subject)
s.write(out, p7, buf, SMIME.PKCS7_TEXT)
smtp = smtplib.SMTP()
smtp.connect(smtpd)
smtp.login("account","password")
smtp.sendmail(from_addr, to_addr, out.read())
smtp.quit()
I also tried to modify the above code, but all I get was the following er
ror
message from Outlook Cant open this item. An error occurred in the
underlying security system.
Does anybody experience the same problem? Anybody tried to verify smime
signed messages with outlook or thunderbird?
Anybody know how to modify the code to work with Outlook and Thunderbird?