[PYTHON-CRYPTO] M2Crypto SMIME Mail verification error in Outlook and Thunderbird

Patrick Hagelkruys patrick.hagelkruys at A-TRUST.AT
Tue Mar 21 10:39:31 CET 2006


I tried to digital sign a message with m2crypto and verify it with Outlook.
But Outlook (also Thunderbird) failed to verify the signature, because the
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 error
message from Outlook “Can’t 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?


More information about the python-crypto mailing list