diff options
author | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-02-28 18:46:01 +0100 |
---|---|---|
committer | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-02-28 18:46:01 +0100 |
commit | acf80bddd07d5579cdb20a888b3f9e99e53030a5 (patch) | |
tree | 034a8e364488c89c8e1997f56313d919019afa65 /src/de/gultsch/chat/utils/SASL.java | |
parent | 03d96266f8bbb76e25610e903d74a0afa7dcd03b (diff) |
rebranding
Diffstat (limited to 'src/de/gultsch/chat/utils/SASL.java')
-rw-r--r-- | src/de/gultsch/chat/utils/SASL.java | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/src/de/gultsch/chat/utils/SASL.java b/src/de/gultsch/chat/utils/SASL.java deleted file mode 100644 index 266f0cb2..00000000 --- a/src/de/gultsch/chat/utils/SASL.java +++ /dev/null @@ -1,24 +0,0 @@ -package de.gultsch.chat.utils; - -import android.util.Base64; - -public class SASL { - public static String plain(String username, String password) { - byte[] userBytes = username.getBytes(); - int userLenght = userBytes.length; - byte[] passwordBytes = password.getBytes(); - byte[] saslBytes = new byte[userBytes.length+passwordBytes.length+2]; - saslBytes[0] = 0x0; - for(int i = 1; i < saslBytes.length; ++i) { - if (i<=userLenght) { - saslBytes[i] = userBytes[i-1]; - } else if (i==userLenght+1) { - saslBytes[i] = 0x0; - } else { - saslBytes[i] = passwordBytes[i-(userLenght+2)]; - } - } - - return Base64.encodeToString(saslBytes, Base64.DEFAULT); - } -} |