org.gridlab.gat.security
Class CertificateSecurityContext

java.lang.Object
  extended by org.gridlab.gat.security.SecurityContext
      extended by org.gridlab.gat.security.CertificateSecurityContext
All Implemented Interfaces:
Cloneable

public class CertificateSecurityContext
extends SecurityContext

A container for security Information based upon certificates. Contexts based upon these mechanisms can be used by adaptors to create further contexts containing opaque data objects, e.g. GSSAPI credentials.


Constructor Summary
CertificateSecurityContext(URI keyfile, URI certfile, String password)
          Constructs a CertificateSecurityContext out of a URI pointing to the private key, a URI pointing to the certificate and a password.
CertificateSecurityContext(URI keyfile, URI certfile, String username, String password)
          Constructs a CertificateSecurityContext out of a URI pointing to the private key, a URI pointing to the certificate, a username and a password.
 
Method Summary
 Object clone()
          Returns a clone of this context.
 boolean equals(Object obj)
          Check two SecurityContexts for equality.
 URI getCertfile()
          Returns the URI of the certificate file.
 URI getKeyfile()
          Returns the location of the keyfile associated with the context.
 int getPrivateKeySlot()
          Returns the private key slot.
 int hashCode()
           
 void setCertfile(URI certfile)
          Set the location of the certificate file.
 void setKeyfile(URI keyfile)
          Sets the location of the keyfile associated with the context.
 void setPrivateKeySlot(int privateKeySlot)
          Sets the private key slot.
 String toString()
           
 
Methods inherited from class org.gridlab.gat.security.SecurityContext
addNote, containsNoteKey, getDataObject, getNoteValue, getPassword, getUsername, isValidFor, putDataObject, removeDataObject, setPassword, setUsername
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CertificateSecurityContext

public CertificateSecurityContext(URI keyfile,
                                  URI certfile,
                                  String username,
                                  String password)
Constructs a CertificateSecurityContext out of a URI pointing to the private key, a URI pointing to the certificate, a username and a password.

Parameters:
keyfile - the private key file (for example userkey.pem)
certfile - the certificate file (for example usercert.pem)
username - the username
password - the password or passphrase belonging to the key and certificate.

CertificateSecurityContext

public CertificateSecurityContext(URI keyfile,
                                  URI certfile,
                                  String password)
Constructs a CertificateSecurityContext out of a URI pointing to the private key, a URI pointing to the certificate and a password.

Parameters:
keyfile - the private key file (for example userkey.pem)
certfile - the certificate file (for example usercert.pem)
password - the password or passphrase belonging to the key and certificate.
Method Detail

equals

public boolean equals(Object obj)
Check two SecurityContexts for equality.

Specified by:
equals in class SecurityContext
Parameters:
obj - the object to compare this with
Returns:
true if the objects are semantically equal

clone

public Object clone()
             throws CloneNotSupportedException
Returns a clone of this context.

Specified by:
clone in class SecurityContext
Returns:
the clone of this security context (but not the associated adaptor data)
Throws:
CloneNotSupportedException

getKeyfile

public URI getKeyfile()
Returns the location of the keyfile associated with the context.

Returns:
The location of the keyfile associated with the context.

setKeyfile

public void setKeyfile(URI keyfile)
Sets the location of the keyfile associated with the context.

Parameters:
keyfile - the location of the keyfile associated with the context.

hashCode

public int hashCode()
Specified by:
hashCode in class SecurityContext

toString

public String toString()
Overrides:
toString in class Object

getPrivateKeySlot

public int getPrivateKeySlot()
Returns the private key slot. Some ssh implementations on windows (tunnelier) use a private key slot.

Returns:
the private key slot.

setPrivateKeySlot

public void setPrivateKeySlot(int privateKeySlot)
Sets the private key slot. Some ssh implementations on windows (tunnelier) use a private key slot.

Parameters:
privateKeySlot - the new private key slot.

getCertfile

public URI getCertfile()
Returns the URI of the certificate file.

Returns:
the URI of the certificate file.

setCertfile

public void setCertfile(URI certfile)
Set the location of the certificate file.

Parameters:
certfile - the location of the certificate file.