Class GssApiMechanisms
- java.lang.Object
-
- org.eclipse.jgit.internal.transport.sshd.GssApiMechanisms
-
public class GssApiMechanisms extends Object
Global repository of GSS-API mechanisms that we can use.
-
-
Field Summary
Fields Modifier and Type Field Description static StringGSSAPI_HOST_PREFIXPrefix to use withGSSName.NT_HOSTBASED_SERVICE.static OidKERBEROS_5TheOidof Kerberos 5.static OidSPNEGOSGNEGO is not to be used with ssh.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcloseContextSilently(GSSContext context)Closes (disposes of) aGSSContextignoring anyGSSExceptions.static GSSContextcreateContext(Oid mechanism, String fqdn)Creates aGSSContextfor the given mechanism to authenticate with the host given byfqdn.static voidfailed(Oid mechanism)Mark the mechanisms as failed.static StringgetCanonicalName(InetSocketAddress remote)Determines a canonical host name for use use with GSS-API.static Collection<Oid>getSupportedMechanisms()Retrieves an immutable collection of the supported mechanisms.static InetAddressresolve(InetSocketAddress remote)Resolves anInetSocketAddress.static voidworked(Oid mechanism)Report that this mechanism was used successfully.
-
-
-
Field Detail
-
GSSAPI_HOST_PREFIX
public static final String GSSAPI_HOST_PREFIX
Prefix to use withGSSName.NT_HOSTBASED_SERVICE.- See Also:
- Constant Field Values
-
SPNEGO
public static final Oid SPNEGO
SGNEGO is not to be used with ssh.
-
-
Method Detail
-
getSupportedMechanisms
@NonNull public static Collection<Oid> getSupportedMechanisms()
Retrieves an immutable collection of the supported mechanisms.- Returns:
- the supported mechanisms
-
worked
public static void worked(@NonNull Oid mechanism)
Report that this mechanism was used successfully.- Parameters:
mechanism- that worked
-
failed
public static void failed(@NonNull Oid mechanism)
Mark the mechanisms as failed.- Parameters:
mechanism- to mark
-
resolve
public static InetAddress resolve(@NonNull InetSocketAddress remote)
Resolves anInetSocketAddress.- Parameters:
remote- to resolve- Returns:
- the resolved
InetAddress, ornullif unresolved.
-
getCanonicalName
@NonNull public static String getCanonicalName(@NonNull InetSocketAddress remote)
Determines a canonical host name for use use with GSS-API.- Parameters:
remote- to get the host name from- Returns:
- the canonical host name, if it can be determined, otherwise the
unprocessed host name.
-
createContext
public static GSSContext createContext(@NonNull Oid mechanism, @NonNull String fqdn)
Creates aGSSContextfor the given mechanism to authenticate with the host given byfqdn.- Parameters:
mechanism-Oidof the mechanism to usefqdn- fully qualified domain name of the host to authenticate with- Returns:
- the context, if the mechanism is available and the context could
be created, or
nullotherwise
-
closeContextSilently
public static void closeContextSilently(GSSContext context)
Closes (disposes of) aGSSContextignoring anyGSSExceptions.- Parameters:
context- to dispose
-
-