Package org.globus.gsi.gssapi.auth
Class IdentityAuthorization
- java.lang.Object
-
- org.globus.gsi.gssapi.auth.Authorization
-
- org.globus.gsi.gssapi.auth.GSSAuthorization
-
- org.globus.gsi.gssapi.auth.IdentityAuthorization
-
public class IdentityAuthorization extends GSSAuthorization
Implements a simple identity authorization mechanism. The given identify is compared with the peer's identity.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String_identity
-
Constructor Summary
Constructors Modifier Constructor Description protectedIdentityAuthorization()Constructor used by superclasses.IdentityAuthorization(java.lang.String identity)Creates a new instance of this class with given expected identity.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidauthorize(org.ietf.jgss.GSSContext context, java.lang.String host)Performs identity authorization.booleanequals(java.lang.Object o)org.ietf.jgss.GSSNamegetExpectedName(org.ietf.jgss.GSSCredential cred, java.lang.String host)Returns expectedGSSNameused for authorization purposes.java.lang.StringgetIdentity()Returns the expected identity.inthashCode()voidsetIdentity(java.lang.String identity)Sets the expected identity for the authorization check.-
Methods inherited from class org.globus.gsi.gssapi.auth.Authorization
generateAuthorizationException
-
-
-
-
Constructor Detail
-
IdentityAuthorization
protected IdentityAuthorization()
Constructor used by superclasses.
-
IdentityAuthorization
public IdentityAuthorization(java.lang.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(java.lang.String identity)
Sets the expected identity for the authorization check.- Parameters:
identity- the expected identity. Must not be null.
-
getIdentity
public java.lang.String getIdentity()
Returns the expected identity.- Returns:
- the expected identity.
-
getExpectedName
public org.ietf.jgss.GSSName getExpectedName(org.ietf.jgss.GSSCredential cred, java.lang.String host) throws org.ietf.jgss.GSSExceptionDescription copied from class:GSSAuthorizationReturns expectedGSSNameused for authorization purposes. Can returns null for self authorization.- Specified by:
getExpectedNamein classGSSAuthorization- Parameters:
cred- credentials usedhost- host address of the peer.- Throws:
org.ietf.jgss.GSSException- if unable to create the name.
-
authorize
public void authorize(org.ietf.jgss.GSSContext context, java.lang.String host) throws AuthorizationExceptionPerforms identity authorization. The given identity is compared with the peer's identity.- Specified by:
authorizein classAuthorization- Parameters:
context- the security contexthost- host address of the peer.- Throws:
AuthorizationException- if the peer's identity does not match the expected identity.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-