[gmime-devel] Problem to provide private keys to a gmime-pkcs7 crypto context



Hello guy's...

I am developing an application : linux squeeze, gmime 2.6, C.

This appli is inside a Milter filter. In that filter, i want to create for each entering Email, a tree of the Email : the sub branch are the attachement, but if one attachement is an Email,
i create a sub-object Email, and again, if this Email got attachement etc...

In the case of 'regular' mail's, i have no problem.

As soon as i detect an email is encrypted, i go thrue a process to decrypt.
As soon as i detect a signature, i check it.

The source got examples, but without the data : the test email, the certificates, keys etc. (check gmime-x.x.x/examples

So, there is no way to do a test. Nowhere any specification about cert's, key's is given.

I have got no problem to import public keys.

I cannot import any private keys.
I created those keys (.P12) with openssl, idem for the public key (.pem), and i use them with no problem with thunderbird (Win7) and my program in .NET

I see that gmime use gpgme, and gpgsm also.

I noticed that gmime and gpgsm accept/reject the same certificates.

I am looking for a set of files to allow the test tasks : do i need the root cacert.crt ? do i need to privide the private, public and cacert in a certain order ?

Could you please send me a useable private key (.P12?) known to be "importable" by gmime ? I would examine it in details, and will try to adapt...
I would adapt anyway, but if one of you could generate this set for guyname guysurname briosofttest com.

Or send me the openssl magic receipt.

Mine is :

echo "******************Generating key...";
openssl req -new -batch -passout "pass:$passwd" -nodes -out $mailname@$domainname-req.pem -keyout $mailname@$domainname-key.pem -days 3650 -config  CERT-openssl.cnf

echo "******************Generating certification request...";
openssl ca -passin pass:$passcertificateur -batch -out $mailname@$domainname-cert.pem  -days 3650 -config CERT-openssl.cnf -infiles $mailname@$domainname-req.pem

echo "*****************Certifying...";
mkdir $PGDATADIR/$domainname
openssl pkcs12 -export -passout "pass:$passwd" -in $mailname@$domainname-cert.pem -inkey $mailname@$domainname-key.pem \
                                                     -certfile /etc/ssl/$certificateur/cacert.crt     -name "$nomcomplet" -out $PGDATADIR/$domainname/$mailname@$domainname-cert.p12

echo "*****************Extracting Pub Key...";
openssl pkcs12 -passin "pass:$passwd" -nokeys -clcerts -in $PGDATADIR/$domainname/$mailname@$domainname-cert.p12 -out $PGDATADIR/$domainname/$mailname@$domainname-pub.pem


I suppose i missed something....

Seb







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]