SECITEM_FreeItem(derSerial, PR_TRUE);
PK11_FindCertByIssuerAndSN(PK11SlotInfo **slotPtr, CERTIssuerAndSN *issuerSN,							 void *wincx){#ifdef NSS_CLASSIC    CK_OBJECT_HANDLE certHandle;    CERTCertificate *cert = NULL;    CK_OBJECT_CLASS certClass = CKO_CERTIFICATE;    CK_ATTRIBUTE searchTemplate[] = { 	{ CKA_CLASS, NULL, 0 },	{ CKA_ISSUER, NULL, 0 },	{ CKA_SERIAL_NUMBER, NULL, 0}    };    int count = sizeof(searchTemplate)/sizeof(CK_ATTRIBUTE);    CK_ATTRIBUTE *attrs = searchTemplate;    PK11_SETATTRS(attrs, CKA_CLASS, &certClass, sizeof(certClass)); attrs++;    PK11_SETATTRS(attrs, CKA_ISSUER, issuerSN->derIssuer.data, 					issuerSN->derIssuer.len); attrs++;    PK11_SETATTRS(attrs, CKA_SERIAL_NUMBER, issuerSN->serialNumber.data, 						issuerSN->serialNumber.len);    certHandle = pk11_FindCertObjectByTemplate					(slotPtr,searchTemplate,count,wincx);    if (certHandle == CK_INVALID_HANDLE) {	return NULL;    }    cert = PK11_MakeCertFromHandle(*slotPtr,certHandle,NULL);    if (cert == NULL) {	PK11_FreeSlot(*slotPtr);	return NULL;    }    return cert;#else    CERTCertificate *rvCert = NULL;    NSSCertificate *cert;    NSSDER issuer, serial;    issuer.data = (void *)issuerSN->derIssuer.data;    issuer.size = (PRUint32)issuerSN->derIssuer.len;    serial.data = (void *)issuerSN->serialNumber.data;    serial.size = (PRUint32)issuerSN->serialNumber.len;    /* XXX login to slots */    cert = NSSTrustDomain_FindCertificateByIssuerAndSerialNumber(                                                  STAN_GetDefaultTrustDomain(),                                                  &issuer,                                                  &serial);    if (cert) {	rvCert = STAN_GetCERTCertificate(cert);	if (slotPtr) *slotPtr = PK11_ReferenceSlot(rvCert->slot);    }    return rvCert;#endif}