@ Override public void process ( SshServer sshd ) throws ExtensionException { // load the URLKeyPairProvider implementation ParallelJURLKeyPairProvider urlKeyPairProvider = null ; ServiceLoader < ParallelJURLKeyPairProvider > loader = CacheableServiceLoader . INSTANCE . load ( ParallelJURLKeyPairProvider . class , ParallelJURLKeyPairProvider . class . getClassLoader ( ) ) ; if ( loader == null || loader . iterator ( ) == null || ! loader . iterator ( ) . hasNext ( ) ) { loader = CacheableServiceLoader . INSTANCE . load ( ParallelJURLKeyPairProvider . class , Thread . currentThread ( ) . getContextClassLoader ( ) ) ; } for ( ParallelJURLKeyPairProvider currentURLKeyPairProvider : loader ) { urlKeyPairProvider = currentURLKeyPairProvider ; break ; } urlKeyPairProvider . setPrivateServerKey ( this . privateServerKey ) ; sshd . setKeyPairProvider ( urlKeyPairProvider ) ; List < NamedFactory < UserAuth > > userAuthFactories = new ArrayList < NamedFactory < UserAuth > > ( ) ; userAuthFactories . add ( new UserAuthPublicKey . Factory ( ) ) ; sshd . setUserAuthFactories ( userAuthFactories ) ; sshd . setPublickeyAuthenticator ( new URLPublicKeyAuthentificator ( this . authorizedServerKey ) ) ; }
Any others configurations for the sshd server can be done directly with the SshServer object from Apache mina SSHD