uk.org.ogsadai.common
Class SecurityContext

java.lang.Object
  |
  +--uk.org.ogsadai.common.SecurityContext

public class SecurityContext
extends java.lang.Object

A wrapper for org.ietf.jgss Grid security credential objects.

Author:
The OGSA-DAI Project Team.

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
           
private static DAILogger LOG
           
private  org.ietf.jgss.GSSCredential mCredential
           
private  java.lang.String mDistinguishedName
           
static java.lang.String NO_CERTIFICATE_PROVIDED
          Default distinguished name if none can be found
 
Constructor Summary
SecurityContext(java.lang.String distinguishedName, org.ietf.jgss.GSSCredential credential)
          Constructor that takes a distinguished name and a credential for this context.
 
Method Summary
 org.ietf.jgss.GSSCredential getCredential()
          Gets the credential.
 java.lang.String getDN()
          Gets the distinguished name.
private  java.lang.String getDNFromCredential(org.ietf.jgss.GSSCredential credential)
          If the credential isn't null and contains a distinguished name then return the name.
 void setCredential(org.ietf.jgss.GSSCredential credential)
          Sets the credential for this security context.
 void setDN(java.lang.String distinguishedName)
          Sets the distinguished name for this context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT_NOTICE

private static final java.lang.String COPYRIGHT_NOTICE
See Also:
Constant Field Values

LOG

private static final DAILogger LOG

NO_CERTIFICATE_PROVIDED

public static final java.lang.String NO_CERTIFICATE_PROVIDED
Default distinguished name if none can be found

See Also:
Constant Field Values

mDistinguishedName

private java.lang.String mDistinguishedName

mCredential

private org.ietf.jgss.GSSCredential mCredential
Constructor Detail

SecurityContext

public SecurityContext(java.lang.String distinguishedName,
                       org.ietf.jgss.GSSCredential credential)
Constructor that takes a distinguished name and a credential for this context. If the distinguished name is null and none can be extracted from the credential then the default of NO_CERTIFICATE_PROVIDED is set.

Parameters:
distinguishedName - The distinguished name of the caller.
credential - The credential provided by the caller.
Method Detail

getCredential

public org.ietf.jgss.GSSCredential getCredential()
Gets the credential.

Returns:
the credential.

getDN

public java.lang.String getDN()
Gets the distinguished name.

Returns:
the distinguished name.

setCredential

public void setCredential(org.ietf.jgss.GSSCredential credential)
Sets the credential for this security context. If a distinguished name can be retrieved from this credential, it is also set in this context.

Parameters:
credential - The credential.

getDNFromCredential

private java.lang.String getDNFromCredential(org.ietf.jgss.GSSCredential credential)
If the credential isn't null and contains a distinguished name then return the name.

Parameters:
credential - The credential.
Returns:
the distinguished name from the credential.

setDN

public void setDN(java.lang.String distinguishedName)
Sets the distinguished name for this context. If the distinguished name is null the default of NO_CERTIFICATE_PROVIDED is set.

Parameters:
distinguishedName - The distinguished name.