CERT_DestroyCertificateList(certlist);
NSS_CMSSignedData_AddCertChain(NSSCMSSignedData *sigd, CERTCertificate *cert){    CERTCertificateList *certlist;    SECCertUsage usage;    SECStatus rv;    usage = certUsageEmailSigner;    /* do not include root */    certlist = CERT_CertChainFromCert(cert, usage, PR_FALSE);    if (certlist == NULL)	return SECFailure;    rv = NSS_CMSSignedData_AddCertList(sigd, certlist);    CERT_DestroyCertificateList(certlist);    return rv;}