Class IdentityAuthorization


  • public class IdentityAuthorization
    extends GSSAuthorization
    Implements a simple identity authorization mechanism. The given identify is compared with the peer's identity.
    • 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.
        Specified by:
        authorize in class Authorization
        Parameters:
        context - the security context
        host - host address of the peer.
        Throws:
        AuthorizationException - if the peer's identity does not match the expected identity.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object