Class GssApiWithMicAuthentication

  • All Implemented Interfaces:
    org.apache.sshd.client.auth.UserAuth, org.apache.sshd.client.session.ClientSessionHolder, org.apache.sshd.common.auth.UserAuthInstance<org.apache.sshd.client.session.ClientSession>, org.apache.sshd.common.NamedResource

    public class GssApiWithMicAuthentication
    extends org.apache.sshd.client.auth.AbstractUserAuth
    GSSAPI-with-MIC authentication handler (Kerberos 5).
    See Also:
    RFC 4462
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void close​(boolean silent)  
      void destroy()  
      private java.lang.String getHostName​(org.apache.sshd.client.session.ClientSession session)  
      protected boolean processAuthDataRequest​(org.apache.sshd.client.session.ClientSession session, java.lang.String service, org.apache.sshd.common.util.buffer.Buffer in)  
      private void replyToken​(org.apache.sshd.client.session.ClientSession session, java.lang.String service, byte[] bytes)  
      protected boolean sendAuthDataRequest​(org.apache.sshd.client.session.ClientSession session, java.lang.String service)  
      private void sendMic​(org.apache.sshd.client.session.ClientSession session, java.lang.String service)  
      private void sendToken​(org.apache.sshd.client.session.ClientSession session, byte[] receivedToken)  
      private boolean unexpectedMessage​(int command)  
      • Methods inherited from class org.apache.sshd.client.auth.AbstractUserAuth

        getClientSession, getName, getService, getSession, init, process, toString
      • Methods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean

        debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • SSH_MSG_USERAUTH_GSSAPI_RESPONSE

        private static final byte SSH_MSG_USERAUTH_GSSAPI_RESPONSE
        Synonym used in RFC 4462.
        See Also:
        Constant Field Values
      • SSH_MSG_USERAUTH_GSSAPI_TOKEN

        private static final byte SSH_MSG_USERAUTH_GSSAPI_TOKEN
        Synonym used in RFC 4462.
        See Also:
        Constant Field Values
      • mechanisms

        private java.util.Collection<org.ietf.jgss.Oid> mechanisms
      • nextMechanism

        private java.util.Iterator<org.ietf.jgss.Oid> nextMechanism
      • currentMechanism

        private org.ietf.jgss.Oid currentMechanism
      • context

        private org.ietf.jgss.GSSContext context
    • Method Detail

      • sendAuthDataRequest

        protected boolean sendAuthDataRequest​(org.apache.sshd.client.session.ClientSession session,
                                              java.lang.String service)
                                       throws java.lang.Exception
        Specified by:
        sendAuthDataRequest in class org.apache.sshd.client.auth.AbstractUserAuth
        Throws:
        java.lang.Exception
      • processAuthDataRequest

        protected boolean processAuthDataRequest​(org.apache.sshd.client.session.ClientSession session,
                                                 java.lang.String service,
                                                 org.apache.sshd.common.util.buffer.Buffer in)
                                          throws java.lang.Exception
        Specified by:
        processAuthDataRequest in class org.apache.sshd.client.auth.AbstractUserAuth
        Throws:
        java.lang.Exception
      • destroy

        public void destroy()
        Specified by:
        destroy in interface org.apache.sshd.client.auth.UserAuth
        Overrides:
        destroy in class org.apache.sshd.client.auth.AbstractUserAuth
      • close

        private void close​(boolean silent)
      • sendToken

        private void sendToken​(org.apache.sshd.client.session.ClientSession session,
                               byte[] receivedToken)
                        throws java.io.IOException,
                               org.ietf.jgss.GSSException
        Throws:
        java.io.IOException
        org.ietf.jgss.GSSException
      • sendMic

        private void sendMic​(org.apache.sshd.client.session.ClientSession session,
                             java.lang.String service)
                      throws java.io.IOException,
                             org.ietf.jgss.GSSException
        Throws:
        java.io.IOException
        org.ietf.jgss.GSSException
      • replyToken

        private void replyToken​(org.apache.sshd.client.session.ClientSession session,
                                java.lang.String service,
                                byte[] bytes)
                         throws java.io.IOException,
                                org.ietf.jgss.GSSException
        Throws:
        java.io.IOException
        org.ietf.jgss.GSSException
      • getHostName

        private java.lang.String getHostName​(org.apache.sshd.client.session.ClientSession session)
      • unexpectedMessage

        private boolean unexpectedMessage​(int command)