public class AuthentificationComponent extends Object
Modifier and Type | Field and Description |
---|---|
private AuthentificationProcess |
_authentificationProcess
Das Authentifikationsverfahren
|
private Hashtable<String,String> |
_table
Speichert zu dem Namen einer Applikation einen Zufallstext, der mit
getAuthentificationText(String) erzeugt wurde. |
Constructor and Description |
---|
AuthentificationComponent(AuthentificationProcess authentificationProcess) |
Modifier and Type | Method and Description |
---|---|
(package private) boolean |
authentify(String applicationName,
String password,
byte[] encryptedRandomText)
Diese Methode verschlüsselt mit dem Passwort der Appliktion den Zufallstext, der zu einer Applikation gehört.
|
AuthentificationProcess |
getAuthentificationProcess()
Gibt den Authentifikationsprozess zurück, der benutzt wird um die Authentifizierung eines Benutzers zu prüfen.
|
String |
getAuthentificationText(String applicationName)
Generiert für eine Applikation einen Zufallstext und speichert diesen.
|
private Hashtable<String,String> _table
getAuthentificationText(String)
erzeugt wurde.
Als Schlüssel dient der Name der Applikation, als Value wird der Zufallstext zurückgegeben.private AuthentificationProcess _authentificationProcess
public AuthentificationComponent(AuthentificationProcess authentificationProcess)
authentificationProcess
- Verschlüsslungsverfahren, das benutzt wird um Authentifizierungsdaten zu prüfen.public final AuthentificationProcess getAuthentificationProcess()
public final String getAuthentificationText(String applicationName)
applicationName
- Name der Applikation, für den ein Zufallstext erzeugt werden soll.final boolean authentify(String applicationName, String password, byte[] encryptedRandomText)
encryptedRandomText
mit dem gerade erzeugten verschlüsselten Text übereinstimmt.
Ist dies der Fall, so wird true
zurückgegeben.
Die Methode löscht in jedem Fall bei Beendigung den Zufallstext, der zu einer Applikation gehört. Ein zweiter Anmeldeversuch mit dem selben Zufallstext ist
also nicht möglich und wird immer zum Ergebnis false
führen, auch wenn das Passwort richtig ist.applicationName
- Name der Applikation, die sich authentifizieren möchte.password
- Das unverschlüsseltes Passwort der Applikation, die sich authentifizieren möchte.encryptedRandomText
- Verschlüsselter Zufallstext der Applikation, die sich authentifizieren will. Der Zufallstext wurde mit einem Passwort
verschlüsselt.true
, die Authentifizierung war erfolgreich; false
sonst#getAuthentificationText(String)}