Class DefaultClientKexExtensionHandler

    • Constructor Detail

      • DefaultClientKexExtensionHandler

        public DefaultClientKexExtensionHandler()
    • Method Detail

      • handleKexInitProposal

        public void handleKexInitProposal​(Session session,
                                          boolean initiator,
                                          java.util.Map<KexProposalOption,​java.lang.String> proposal)
                                   throws java.io.IOException
        Description copied from interface: KexExtensionHandler
        Invoked when a peer is ready to send the KEX options proposal or has received such a proposal. Note: this method is called during the negotiation phase even if isKexExtensionsAvailable returns false for the session.
        Specified by:
        handleKexInitProposal in interface KexExtensionHandler
        Parameters:
        session - The Session initiating or receiving the proposal
        initiator - true if the proposal is about to be sent, false if this is a proposal received from the peer.
        proposal - The proposal contents - Caveat emptor: the proposal is modifiable i.e., the handler can modify before being sent or before being processed (if incoming)
        Throws:
        java.io.IOException - If failed to handle the request
      • handleKexExtensionRequest

        public boolean handleKexExtensionRequest​(Session session,
                                                 int index,
                                                 int count,
                                                 java.lang.String name,
                                                 byte[] data)
                                          throws java.io.IOException
        Description copied from interface: KexExtensionHandler
        Invoked by KexExtensionHandler.handleKexExtensionsMessage(Session, Buffer) in order to handle a specific extension.
        Specified by:
        handleKexExtensionRequest in interface KexExtensionHandler
        Parameters:
        session - The Session through which the message was received
        index - The 0-based extension index
        count - The total extensions in the message
        name - The extension name
        data - The extension data
        Returns:
        true whether to proceed to the next extension or stop processing the rest
        Throws:
        java.io.IOException - If failed to handle the extension
      • updateAvailableSignatureFactories

        public java.util.List<NamedFactory<Signature>> updateAvailableSignatureFactories​(Session session,
                                                                                         java.util.Collection<java.lang.String> extraAlgos)
                                                                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • resolveUpdatedSignatureFactories

        public java.util.List<NamedFactory<Signature>> resolveUpdatedSignatureFactories​(Session session,
                                                                                        java.util.List<NamedFactory<Signature>> available,
                                                                                        java.util.Collection<java.lang.String> extraAlgos)
                                                                                 throws java.io.IOException
        Checks if the extra signature algorithms are already included in the available ones, and adds the extra ones (if supported).
        Parameters:
        session - The Session for which the resolution occurs
        available - The available signature factories
        extraAlgos - The extra requested signatures - ignored if null/empty
        Returns:
        The resolved signature factories - same as input if nothing added
        Throws:
        java.io.IOException - If failed to resolve the factories
      • resolvePreferredSignaturePosition

        public int resolvePreferredSignaturePosition​(Session session,
                                                     java.util.List<? extends NamedFactory<Signature>> factories,
                                                     NamedFactory<Signature> factory)
                                              throws java.io.IOException
        Throws:
        java.io.IOException
      • resolveRequestedSignatureFactories

        public java.util.List<NamedFactory<Signature>> resolveRequestedSignatureFactories​(Session session,
                                                                                          java.util.Collection<java.lang.String> extraAlgos)
                                                                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • resolveRequestedSignatureFactory

        public NamedFactory<Signature> resolveRequestedSignatureFactory​(Session session,
                                                                        java.lang.String name)
                                                                 throws java.io.IOException
        Throws:
        java.io.IOException