Package org.globus.gsi.gssapi.auth
Class HostAuthorization
- java.lang.Object
-
- org.globus.gsi.gssapi.auth.Authorization
-
- org.globus.gsi.gssapi.auth.GSSAuthorization
-
- org.globus.gsi.gssapi.auth.HostAuthorization
-
public class HostAuthorization extends GSSAuthorization
Implements a simple host authorization mechanism. The peer's host name (in FQDN form) is compared with the host name specified in the peer's certificate chain.
-
-
Field Summary
Fields Modifier and Type Field Description static HostAuthorizationldapAuthorization
-
Constructor Summary
Constructors Constructor Description HostAuthorization(java.lang.String service)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidauthorize(org.ietf.jgss.GSSContext context, java.lang.String host)Performs host authentication.booleanequals(java.lang.Object o)org.ietf.jgss.GSSNamegetExpectedName(org.ietf.jgss.GSSCredential cred, java.lang.String host)Returns expectedGSSNameused for authorization purposes.static HostAuthorizationgetInstance()Returns an instance of host authentication.inthashCode()-
Methods inherited from class org.globus.gsi.gssapi.auth.Authorization
generateAuthorizationException
-
-
-
-
Field Detail
-
ldapAuthorization
public static final HostAuthorization ldapAuthorization
-
-
Method Detail
-
getInstance
public static HostAuthorization getInstance()
Returns an instance of host authentication.- Returns:
- an instance of this class initialized with host as a service.
-
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 host authentication. The hostname of the peer is compared with the hostname specified in the peer's (topmost) certificate in the certificate chain. The hostnames must match exactly (in case-insensitive way)- Specified by:
authorizein classAuthorization- Parameters:
context- the security contexthost- host address of the peer.- Throws:
AuthorizationException- if the hostnames do not match.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-