de.bsvrz.dav.dav.main
Class AuthentificationComponent

java.lang.Object
  extended by de.bsvrz.dav.dav.main.AuthentificationComponent

public class AuthentificationComponent
extends Object

Diese Klasse enhält die Komponenten zur Authentifizierung eines Benutzers/Applikation.

Author:
Kappich Systemberatung

Field Summary
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 Summary
AuthentificationComponent(AuthentificationProcess authentificationProcess)
           
 
Method Summary
(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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_table

private Hashtable<String,String> _table
Speichert zu dem Namen einer Applikation einen Zufallstext, der mit getAuthentificationText(String) erzeugt wurde.

Als Schlüssel dient der Name der Applikation, als Value wird der Zufallstext zurückgegeben.


_authentificationProcess

private AuthentificationProcess _authentificationProcess
Das Authentifikationsverfahren

Constructor Detail

AuthentificationComponent

public AuthentificationComponent(AuthentificationProcess authentificationProcess)
Parameters:
authentificationProcess - Verschlüsslungsverfahren, das benutzt wird um Authentifizierungsdaten zu prüfen.
Method Detail

getAuthentificationProcess

public final AuthentificationProcess getAuthentificationProcess()
Gibt den Authentifikationsprozess zurück, der benutzt wird um die Authentifizierung eines Benutzers zu prüfen.

Returns:
authentificationProcess der Authentifikationsprozess

getAuthentificationText

public final String getAuthentificationText(String applicationName)
Generiert für eine Applikation einen Zufallstext und speichert diesen.

Parameters:
applicationName - Name der Applikation, für den ein Zufallstext erzeugt werden soll.
Returns:
Zufallstext. Jeder Aufruf der Methode, mit der selben Applikation, gibt den selben Zufallstext zurück.

authentify

final 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. Danach wird geprüft, ob der übergebene verschlüsselte Text 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.

Parameters:
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.
Returns:
true, die Authentifizierung war erfolgreich; false sonst
See Also:
#getAuthentificationText(String)}