PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
PORT_SetError(SEC_ERROR_INVALID_ARGS);
NSS_CMSSignedData_VerifySignerInfo(NSSCMSSignedData *sigd, int i, 			    CERTCertDBHandle *certdb, SECCertUsage certusage){    NSSCMSSignerInfo *signerinfo;    NSSCMSContentInfo *cinfo;    SECOidData *algiddata;    SECItem *contentType, *digest;    SECOidTag oidTag;    SECStatus rv;    PORT_Assert(sigd);    if (!sigd) {        PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);        return SECFailure;    }    cinfo = &(sigd->contentInfo);    signerinfo = sigd->signerInfos[i];    /* verify certificate */    rv = NSS_CMSSignerInfo_VerifyCertificate(signerinfo, certdb, certusage);    if (rv != SECSuccess)	return rv; /* error is set */    /* find digest and contentType for signerinfo */    algiddata = NSS_CMSSignerInfo_GetDigestAlg(signerinfo);    oidTag = algiddata ? algiddata->offset : SEC_OID_UNKNOWN;    digest = NSS_CMSSignedData_GetDigestValue(sigd, oidTag);    /* NULL digest is acceptable. */    contentType = NSS_CMSContentInfo_GetContentTypeOID(cinfo);    /* NULL contentType is acceptable. */    /* now verify signature */    rv = NSS_CMSSignerInfo_Verify(signerinfo, digest, contentType);    return rv;}