digest = NSS_CMSSignedData_GetDigestByAlgTag(sigd, algiddata->offset);
digest = NSS_CMSSignedData_GetDigestValue(sigd, algiddata->offset);
NSS_CMSSignedData_VerifySignerInfo(NSSCMSSignedData *sigd, int i, 			    CERTCertDBHandle *certdb, SECCertUsage certusage){    NSSCMSSignerInfo *signerinfo;    NSSCMSContentInfo *cinfo;    SECOidData *algiddata;    SECItem *contentType, *digest;    SECStatus rv;    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);    if (!algiddata)    	return SECFailure;  /* error code is set */    digest = NSS_CMSSignedData_GetDigestByAlgTag(sigd, algiddata->offset);    if (!digest) {	PORT_SetError(SEC_ERROR_PKCS7_BAD_SIGNATURE);    	return SECFailure;    }    contentType = NSS_CMSContentInfo_GetContentTypeOID(cinfo);    if (!contentType) {	PORT_SetError(SEC_ERROR_PKCS7_BAD_SIGNATURE);    	return SECFailure;    }    /* now verify signature */    rv = NSS_CMSSignerInfo_Verify(signerinfo, digest, contentType);    return rv;}