Top Description Fields Constructors Methods
org.eclipse.jgit.internal.transport.sshd

public Class GssApiMechanisms

extends Object
Class Inheritance
Imports
java.net.InetAddress, .InetSocketAddress, .UnknownHostException, java.util.Collection, .Collections, .LinkedHashMap, .Map, java.util.concurrent.atomic.AtomicBoolean, org.eclipse.jgit.annotations.NonNull, org.ietf.jgss.GSSContext, .GSSException, .GSSManager, .GSSName, .Oid

Global repository of GSS-API mechanisms that we can use.

Field Summary

Modifier and TypeField and Description
public static final String
public static final Oid
KERBEROS_5

The Oid of Kerberos 5.

private static final Object
public static final Oid
SPNEGO

SGNEGO is not to be used with ssh.

private static Map<Oid, Boolean>
supportedMechanisms

The AtomicBoolean is set to true when the mechanism could be initialized successfully at least once.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static void
closeContextSilently(GSSContext
to dispose
context
)

Closes (disposes of) a GSSContext ignoring any GSSExceptions.

public static GSSContext

Returns:

the context, if the mechanism is available and the context could be created, or null otherwise
createContext
(Oid
Oid of the mechanism to use
mechanism
,
String
fully qualified domain name of the host to authenticate with
fqdn
)

Creates a GSSContext for the given mechanism to authenticate with the host given by fqdn.

private static Oid
public static void
failed(Oid
to mark
mechanism
)

Mark the mechanisms as failed.

public static String

Returns:

the canonical host name, if it can be determined, otherwise the unprocessed host name.
getCanonicalName
(InetSocketAddress
to get the host name from
remote
)

Determines a canonical host name for use use with GSS-API.

public static Collection<Oid>

Returns:

the supported mechanisms
getSupportedMechanisms
()

Retrieves an immutable collection of the supported mechanisms.

public static InetAddress

Returns:

the resolved InetAddress, or null if unresolved.
resolve
(InetSocketAddress
to resolve
remote
)

Resolves an InetSocketAddress.

public static void
worked(Oid
that worked
mechanism
)

Report that this mechanism was used successfully.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

GSSAPI_HOST_PREFIXback to summary
public static final String GSSAPI_HOST_PREFIX

Prefix to use with GSSName#NT_HOSTBASED_SERVICE.

KERBEROS_5back to summary
public static final Oid KERBEROS_5

The Oid of Kerberos 5.

LOCKback to summary
private static final Object LOCK

Protects supportedMechanisms.

SPNEGOback to summary
public static final Oid SPNEGO

SGNEGO is not to be used with ssh.

supportedMechanismsback to summary
private static Map<Oid, Boolean> supportedMechanisms

The AtomicBoolean is set to true when the mechanism could be initialized successfully at least once.

Constructor Detail

GssApiMechanismsback to summary
private GssApiMechanisms()

Method Detail

closeContextSilentlyback to summary
public static void closeContextSilently(GSSContext context)

Closes (disposes of) a GSSContext ignoring any GSSExceptions.

Parameters
context:GSSContext

to dispose

createContextback to summary
public static GSSContext createContext(Oid mechanism, String fqdn)

Creates a GSSContext for the given mechanism to authenticate with the host given by fqdn.

Parameters
mechanism:Oid

Oid of the mechanism to use

fqdn:String

fully qualified domain name of the host to authenticate with

Returns:GSSContext

the context, if the mechanism is available and the context could be created, or null otherwise

createOidback to summary
private static Oid createOid(String rep)
failedback to summary
public static void failed(Oid mechanism)

Mark the mechanisms as failed.

Parameters
mechanism:Oid

to mark

getCanonicalNameback to summary
public static String getCanonicalName(InetSocketAddress remote)

Determines a canonical host name for use use with GSS-API.

Parameters
remote:InetSocketAddress

to get the host name from

Returns:String

the canonical host name, if it can be determined, otherwise the unprocessed host name.

Annotations
@NonNull
getSupportedMechanismsback to summary
public static Collection<Oid> getSupportedMechanisms()

Retrieves an immutable collection of the supported mechanisms.

Returns:Collection<Oid>

the supported mechanisms

Annotations
@NonNull
resolveback to summary
public static InetAddress resolve(InetSocketAddress remote)

Resolves an InetSocketAddress.

Parameters
remote:InetSocketAddress

to resolve

Returns:InetAddress

the resolved InetAddress, or null if unresolved.

workedback to summary
public static void worked(Oid mechanism)

Report that this mechanism was used successfully.

Parameters
mechanism:Oid

that worked