Академический Документы
Профессиональный Документы
Культура Документы
/* * To change this template, choose Tools | Templates * and open the template in the editor. */
DatagramSocket welcomeSocket;
PrivilagedAccessVerfier priaccessverfier;
private ServerComm() {
instance.start();
} return instance;
Collection c = ipaddrtoallow.values();
Iterator it = c.iterator();
while(it.hasNext()) { System.out.println((String)it.next());
System.out.println("****************************************");
printAllowedIPTable();
return false;
//}
//return true;
MessageDigest md = MessageDigest.getInstance("SHA1");
md.update(fullmsg.getBytes());
System.out.println(" "+bytesToHex(output));
bytes[3] = output[0];
return result;
} catch(Exception e) { e.printStackTrace(); }
return null; }
public static String bytesToHex(byte[] b) { char hexDigit[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; StringBuffer buf = new StringBuffer(); for (int j=0; j<b.length; j++) { buf.append(hexDigit[(b[j] >> 4) & 0x0f]); buf.append(hexDigit[b[j] & 0x0f]); } return buf.toString(); }
while (true) {
ipaddrtoallow.put(t[1],t[1]);
printAllowedIPTable();
} else if(sentence.startsWith("KEY#")) {
String [] t = sentence.split("#");
keyatthisperiod = t[1];
priaccessverfier.setKey(Integer.parseInt(keyatthisperiod));
} catch(Exception e) { e.printStackTrace(); }