Re: M2Crypto and CAcert.org certificates

Heikki Toivonen <[email protected]> Tue, 28 Oct 2008 20:53:09 -0700
Newsgroups gmane.comp.python.cryptography
Message-ID <[email protected]>
Jeremy Morel wrote:
> I am trying to use M2Crypto to authentify mails signed with a certificate
> delivered by CACert.org. I understand they do not use traditional public
> key/private key signing, but rather give you a certificate you use to sign
> your mails with embed the public key. Toying with M2Crypto, I was able to

Can you send a link to where they explain this stuff?

> My code derives from the example available at

That is from the old M2Crypto location. M2Crypto homepage is now here:
http://chandlerproject.org/Projects/MeTooCrypto and the new location for
the document you were reading is
http://svn.osafoundation.org/m2crypto/trunk/doc/howto.smime.html

I have fixed one bug in the examples, in the Sign and Encrypt section.

> certif = X509.load_cert('root.crt')

You are not using certif for anything.

> signers = p7.get0_signers(stack)
> for signer in signers:
>     pubkey = signer.get_pubkey()
>     print signer  

That signer is an X509 object...

> # Load the signer's cert.
> x509 = X509.X509()
> x509.set_pubkey(pubkey)

... so why are you creating a new X509 object here, why not use signer?

If it does not work with that modification, could you send me an email
signed with CAcert certificate and point me to a place where I can
download their root cert?

Cheers,

-- 
  Heikki Toivonen - http://heikkitoivonen.net