Removed debug.
Changed getHash to return the Base64 of the SHA-256 of the input.
This commit is contained in:
@ -78,7 +78,6 @@ public class I2PControlController{
|
||||
// throw new IllegalArgumentException("Plugin directory " + pluginDir.getAbsolutePath() + " does not exist");
|
||||
|
||||
|
||||
System.out.println(net.i2p.i2pcontrol.security.jbcrypt.BCrypt.hashpw("itoopie","$2a$11$5aOLx2x/8i4fNaitoCSSWu"));
|
||||
_server = new Server();
|
||||
try {
|
||||
SslListener ssl = new SslListener();
|
||||
|
@ -26,6 +26,8 @@ import javax.net.SocketFactory;
|
||||
import javax.net.ssl.SSLSocket;
|
||||
import javax.net.ssl.SSLSocketFactory;
|
||||
|
||||
import com.sun.org.apache.xml.internal.security.utils.Base64;
|
||||
|
||||
import sun.misc.BASE64Encoder;
|
||||
|
||||
|
||||
@ -109,7 +111,7 @@ public class SecurityManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* Hash input one time with SHA-256.
|
||||
* Hash input one time with SHA-256, return Base64 encdoded string.
|
||||
* @param string
|
||||
* @return
|
||||
*/
|
||||
@ -117,7 +119,7 @@ public class SecurityManager {
|
||||
SHA256Generator hashGen = new SHA256Generator(I2PAppContext.getGlobalContext());
|
||||
byte[] bytes = string.getBytes();
|
||||
bytes = hashGen.calculateHash(bytes).toByteArray();
|
||||
return new String(bytes);
|
||||
return new String(Base64.encode(bytes));
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user