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