View Javadoc
1   /*
2    * Copyright (C) 2018, Thomas Wolf <thomas.wolf@paranor.ch> and others
3    *
4    * This program and the accompanying materials are made available under the
5    * terms of the Eclipse Distribution License v. 1.0 which is available at
6    * https://www.eclipse.org/org/documents/edl-v10.php.
7    *
8    * SPDX-License-Identifier: BSD-3-Clause
9    */
10  package org.eclipse.jgit.internal.transport.sshd;
11  
12  import java.io.IOException;
13  
14  import org.apache.sshd.client.auth.AbstractUserAuthFactory;
15  import org.apache.sshd.client.auth.UserAuth;
16  import org.apache.sshd.client.session.ClientSession;
17  
18  /**
19   * Factory to create {@link GssApiWithMicAuthentication} handlers.
20   */
21  public class GssApiWithMicAuthFactory extends AbstractUserAuthFactory {
22  
23  	/** The authentication identifier for GSSApi-with-MIC. */
24  	public static final String NAME = "gssapi-with-mic"; //$NON-NLS-1$
25  
26  	/** The singleton {@link GssApiWithMicAuthFactory}. */
27  	public static final GssApiWithMicAuthFactory INSTANCE = new GssApiWithMicAuthFactory();
28  
29  	private GssApiWithMicAuthFactory() {
30  		super(NAME);
31  	}
32  
33  	@Override
34  	public UserAuth createUserAuth(ClientSession session)
35  			throws IOException {
36  		return new GssApiWithMicAuthentication();
37  	}
38  
39  }