Hellow.
I need to create (S/MIME) signed e-mail and to do that I
use NSS-3.7.1 and so... I have one big-small problem;)
My personal certificate is embeded on GemSAFE smartcard and now,if I
sign my message without M$ compatibility flag all is ok, but Outlook
2002 have problems ("You cannot read this message because your system
security restrictions bla...bla"), if I try to create with M$
compatibility I have problem :)
NSS can't create NSS_CMSSignerInfo_AddSMIMEEncKeyPrefs, and
NSS_CMSSignerInfo_AddMSSMIMEEncKeyPrefs, why? what's wrong?
Certificate key usage is for signing and encryption.

My source code is like this...
--------------------------------------------------------------------------

...

rv = NSS_InitReadWrite("E:\\Mozilla\\nss-3.7.1\\bin\\mydb");

/*
  PKCS#11 initialization functions
*/

...

        dbmyhandle = CERT_GetDefaultCertDB();

...

if ((ekpcert = CERT_FindUserCertByUsage(
                                  dbmyhandle,
                                  "GemSAFE:certname",
                                  certUsageEmailRecipient,
                                  PR_FALSE,
                                  NULL)) == NULL) 
        {
                printf("error: certificate not found\n");
                return -1;
        }

/*
  In this section (below) program out.
*/
        
if (NSS_CMSSignerInfo_AddSMIMEEncKeyPrefs(signerinfo, ekpcert,
                                  dbmyhandle)
      != SECSuccess) 
        {
                printf("ERROR: cannot add SMIMEEncKeyPrefs attribute.\n");
                return -1;
        }


        rv = NSS_CMSSignerInfo_AddMSSMIMEEncKeyPrefs(signerinfo,ekpcert,
mbmyhandle);

        if(rv!=SECSuccess)
        {
                printf("M$ error\n");
                return -1;
        }

---------------------------------------------------------------------------

Thanks for any sugestions and answers.
With Regards, Zeke.

Reply via email to