Java Globus API: Class IdentityAuthorization

org.globus.gsi.gssapi.auth
Class IdentityAuthorization

java.lang.Object
  |
  +--org.globus.gsi.gssapi.auth.Authorization
        |
        +--org.globus.gsi.gssapi.auth.IdentityAuthorization

public class IdentityAuthorization
extends Authorization

Implements a simple identity authorization mechanism. The given identify is compared with the peer's identity.


Field Summary
protected  String _identity
           
 
Constructor Summary
protected IdentityAuthorization()
          Constructor used by superclasses.
  IdentityAuthorization(String identity)
          Creates a new instance of this class with given expected identity.
 
Method Summary
 void authorize(GSSContext context, String host)
          Performs identity authorization.
 String getIdentity()
          Returns the expected identity.
 void setIdentity(String identity)
          Sets the expected identity for the authorization check.
 
Methods inherited from class org.globus.gsi.gssapi.auth.Authorization
generateAuthorizationException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_identity

protected String _identity
Constructor Detail

IdentityAuthorization

protected IdentityAuthorization()
Constructor used by superclasses.

IdentityAuthorization

public IdentityAuthorization(String identity)
Creates a new instance of this class with given expected identity.
Parameters:
identity - the expected identity. Must not be null.
Method Detail

setIdentity

public void setIdentity(String identity)
Sets the expected identity for the authorization check.
Parameters:
identity - the expected identity. Must not be null.

getIdentity

public String getIdentity()
Returns the expected identity.
Returns:
the expected identity.

authorize

public void authorize(GSSContext context,
                      String host)
               throws AuthorizationException
Performs identity authorization. The given identity is compared with the peer's identity.
Overrides:
authorize in class Authorization
Parameters:
context - the security context
socket - the socket connected to the peer.
Throws:
AuthorizationException - if the peer's identity does not match the expected identity.