List of usage examples for org.apache.shiro.crypto.hash Hash isEmpty
boolean isEmpty();
From source file:com.masslink.idea.zigbee.shiro.UserPasswordService.java
License:Apache License
@Override public boolean passwordsMatch(Object plaintext, Hash savedPassword) { ByteSource plaintextBytes = createByteSource(plaintext); if (savedPassword == null || savedPassword.isEmpty()) { return plaintextBytes == null || plaintextBytes.isEmpty(); } else if (plaintextBytes == null || plaintextBytes.isEmpty()) { return false; }//from w ww. ja v a2 s. c om HashRequest request = buildHashRequest(plaintextBytes, savedPassword); Hash computed = this.hashService.computeHash(request); return savedPassword.equals(computed); }