rv = CERT_FindSubjectKeyIDExten(cert, &tmpitem);
rv = CERT_FindSubjectKeyIDExtension(cert, &tmpitem);
cert_IsRootCert(CERTCertificate *cert){    SECStatus rv;    SECItem tmpitem;    /* cache the authKeyID extension, if present */    cert->authKeyID = CERT_FindAuthKeyIDExten(cert->arena, cert);    /* it MUST be self-issued to be a root */    if (cert->derIssuer.len == 0 ||        !SECITEM_ItemsAreEqual(&cert->derIssuer, &cert->derSubject))    {	return PR_FALSE;    }    /* check the authKeyID extension */    if (cert->authKeyID) {	/* authority key identifier is present */	if (cert->authKeyID->keyID.len > 0) {	    /* the keyIdentifier field is set, look for subjectKeyID */	    rv = CERT_FindSubjectKeyIDExten(cert, &tmpitem);	    if (rv == SECSuccess) {		PRBool match;		/* also present, they MUST match for it to be a root */		match = SECITEM_ItemsAreEqual(&cert->authKeyID->keyID,		                              &tmpitem);		PORT_Free(tmpitem.data);		if (!match) return PR_FALSE; /* else fall through */	    } else {		/* the subject key ID is required when AKI is present */		return PR_FALSE;	    }	}	if (cert->authKeyID->authCertIssuer) {	    SECItem *caName;	    caName = (SECItem *)CERT_GetGeneralNameByType(	                                  cert->authKeyID->authCertIssuer,	                                  certDirectoryName, PR_TRUE);	    if (caName) {		if (!SECITEM_ItemsAreEqual(&cert->derIssuer, caName)) {		    return PR_FALSE;		} /* else fall through */	    } /* else ??? could not get general name as directory name? */	}	if (cert->authKeyID->authCertSerialNumber.len > 0) {	    if (!SECITEM_ItemsAreEqual(&cert->serialNumber,	                         &cert->authKeyID->authCertSerialNumber)) {		return PR_FALSE;	    } /* else fall through */	}	/* all of the AKI fields that were present passed the test */	return PR_TRUE;    }    /* else the AKI was not present, so this is a root */    return PR_TRUE;}