use RSA to encrypt login

This commit is contained in:
Sola
2015-12-13 01:54:11 +08:00
parent abb8891152
commit 0869a5ca7f
15 changed files with 183 additions and 71 deletions

View File

@@ -12,13 +12,17 @@ import javax.servlet.http.HttpSession;
*/
public class Checker {
public static boolean nonNull(Object... v) {
for (Object o : v) if (o == null) return false;
return true;
public static boolean hasNull(Object... v) {
for (Object o : v) if (o == null) return true;
return false;
}
public static boolean authorized(HttpSession s, Command c) {
return s != null && s.getAttribute("authorized") == c;
}
public static boolean operator(HttpSession s) {
return s != null && s.getAttribute("operator") != null;
}
}