edu.washington.cs.pl_if
Class Credentials

java.lang.Object
  extended by edu.washington.cs.pl_if.Credentials

public class Credentials
extends Object

Class holding credentials used both for communication with PLC and for authentication with planetlab hosts.

Author:
isdal

Constructor Summary
Credentials(Map<String,String> credentials)
          Creates a new Config class from a Map containing the following fields:
Credentials(String username, String password, String slice, String role, String keyPath, String keyFilePassword)
           
 
Method Summary
 boolean authenticate(Credentials comp)
          Checks username and password
 boolean authenticateClearTest(Credentials comp)
           
 boolean authenticateMD5(Credentials comp)
           
 boolean equals(Credentials comp)
           
 boolean equals(Map authMap)
           
 boolean equals(Object obj)
           
 Map getAuthMap()
           
 String getKeyFilePassword()
           
 String getKeyPath()
          returns the full path to the private key used from ssh authentication
 String getPassword()
           
 String getPasswordMD5()
           
 Map getPLCMap()
           
 String getRole()
           
 String getSlice()
           
 String getUsername()
           
 String getUsernameMD5()
           
 int hashCode()
           
 boolean isIgnoreCerificateErrors()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Credentials

public Credentials(Map<String,String> credentials)
Creates a new Config class from a Map containing the following fields:

Parameters:
Map - with credentials used for authentication credentials{"Username"} The username credentials{"AuthMethod"} This should always be "password", --to keep it PLC compadable... credentials{"AuthString"} The accutual password credentials{"Slice"} the name of the slice (this is only needed to be able to know what login-name to use for ssh conenctions credentials{"Role"} this is needed for PLC communication

Credentials

public Credentials(String username,
                   String password,
                   String slice,
                   String role,
                   String keyPath,
                   String keyFilePassword)
Method Detail

authenticate

public boolean authenticate(Credentials comp)
Checks username and password

Parameters:
auth -
Returns:
true if username and password matched

authenticateClearTest

public boolean authenticateClearTest(Credentials comp)

authenticateMD5

public boolean authenticateMD5(Credentials comp)

equals

public boolean equals(Credentials comp)

equals

public boolean equals(Map authMap)

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

getAuthMap

public Map getAuthMap()

getKeyFilePassword

public String getKeyFilePassword()

getKeyPath

public String getKeyPath()
returns the full path to the private key used from ssh authentication

Returns:

getPassword

public String getPassword()

getPLCMap

public Map getPLCMap()

isIgnoreCerificateErrors

public boolean isIgnoreCerificateErrors()

getRole

public String getRole()

getSlice

public String getSlice()

getUsername

public String getUsername()

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

getPasswordMD5

public String getPasswordMD5()

getUsernameMD5

public String getUsernameMD5()