Firme della chiave \"" . $search . "\"

0) && (strpos($user, ">") > 0)) $name = trim(substr($user, 0, strrpos($user, "<")-1)); else $name = trim($user); if ($name == "[User id not found]") $name = "[firma non riconosciuta]"; else $name = htmlentities($name); $mail = split("[<>]", substr($user, strrpos($user, "<")-1)); if (count($mail) == 3) $mail = $mail[1]; else $mail = false; $k = str_pad($tipo, 5); if ($bits) $k .= $bits . "/"; else $k .= " "; if ($keyid) $k .= "" . $keyid . " "; else $k .= " "; $k .= str_pad($data, 11); $k .= $name; if ($mail) $k .= " <" . $mail . ">"; $parsed .= $k . "\n"; } return $parsed; } if (!$error && ($op == "get")) { // Cerca una chiave localmente $pgp = new PGP(); $result = $pgp->get($search); } if (!$error && ($op == "verbose")) { // Mostra le firme di una chiave $pgp = new PGP(); $id = $pgp->keys($search); $result = "Tipo bits /chiave Data ID utente\n"; $result .= keyparse($id); $error = false; } else if (!$error && ($op == "index")) { // Cerca una chiave localmente $words = explode("+", $search); $filter = ""; for ($i=0; $i < count($words); $i++) { $filter .= "(cn=*" . utf8_encode($words[$i]) . "*)(mailAlternateAddress=" . $words[$i] .")"; if ($_POST["strutture"]) $filter .= "(ou=" . $words[$i] .")"; } $filter = "(&(pgpkey=*)(|" . $filter . "))"; // Ricerca della entry con l'indirizzo indicato $ds = new DA('ou=staff,dc=unige,dc=it'); $ds->open(true); $data = $ds->search($filter); if ($data["count"] == 0) { $error = "Nessuna chiave valida"; } else { $pgp = new PGP(); $id = array(); for ($i=0; $i < $data["count"]; $i++) { $keys = $data[$i]["pgpkey"]; for ($j=0; $j < $keys["count"]; $j++) { $id[] = $pgp->import($keys[$j]); echo '

' . implode('

', $pgp->lastresult) . '

'; } } $result = "Tipo bits /chiave Data ID utente\n"; for ($i=0; $i < count($id); $i++) { if ($id[$i]) $result .= keyparse($pgp->lookup($id[$i])) . "\n"; else $result .= 'Chiave in formato non valido' . "\n"; } } } ?>

Chiave PGP \"" . $search . "\""; echo "

";
    echo $result;
    echo "

"; } else if ($op == "verbose") { echo "

"; echo "

";
    echo $result;
    echo "

"; } else if ($op == "index") { echo '

'; echo '

';
    echo $result;
    echo '

'; } } else echo $error; ?>