APIdia Launch Partner
Top Description Fields Constructors Methods
sun.security.jgss

public Class GSSUtil

extends Object
Class Inheritance
Imports
javax.security.auth.Subject, javax.security.auth.kerberos.KerberosPrincipal, .KerberosTicket, .KerberosKey, org.ietf.jgss.*, sun.security.jgss.spi.GSSNameSpi, .GSSCredentialSpi, sun.security.jgss.krb5.Krb5NameElement, sun.security.jgss.spnego.SpNegoCredElement, java.util.Set, .HashSet, .Vector, .Iterator, javax.security.auth.callback.CallbackHandler, javax.security.auth.login.LoginContext, .LoginException, sun.security.util.ConsoleCallbackHandler, .Debug

The GSSUtilImplementation that knows how to work with the internals of the GSS-API.

Field Summary

Modifier and TypeField and Description
pack-priv static final Debug
public static final Oid
public static final Oid
public static final Oid
public static final Oid
public static final Oid

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static Oid
createOid(String oidStr)

pack-priv static void
debug(String message)

public static String
public static Subject
getSubject(GSSName name, GSSCredential creds)

Note

The current impl only works with Sun's impl of GSSName and GSSCredential since it depends on package private APIs.

public static boolean
public static boolean
public static Subject

Returns:

the authenticated subject
login
(GSSCaller
the caller of JAAS Login
caller
,
Oid
the mech to be used
mech
)

Authenticate using the login module from the specified configuration entry.

private static void
populateCredentials(Set<Object> credentials, Set<?> gssCredentials)

Populates the set credentials with elements from gssCredentials.

public static <T extends GSSCredentialSpi> Vector<T>
searchSubject(final GSSNameSpi name, final Oid mech, final boolean initiate, final Class<? extends T> credCls)

Searches the private credentials of current Subject with the specified criteria and returns the matching GSSCredentialSpi object out of Sun's impl of GSSCredential.

public static boolean
useMSInterop()

Determines the SPNEGO interoperability mode with Microsoft; by default it is set to true.

public static boolean
useSubjectCredsOnly(GSSCaller caller)

Determines if the application doesn't mind if the mechanism obtains the required credentials from outside the current Subject.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEBUGback to summary
pack-priv static final Debug DEBUG
GSS_KRB5_MECH_OIDback to summary
public static final Oid GSS_KRB5_MECH_OID
GSS_KRB5_MECH_OID2back to summary
public static final Oid GSS_KRB5_MECH_OID2
GSS_KRB5_MECH_OID_MSback to summary
public static final Oid GSS_KRB5_MECH_OID_MS
GSS_SPNEGO_MECH_OIDback to summary
public static final Oid GSS_SPNEGO_MECH_OID
NT_GSS_KRB5_PRINCIPALback to summary
public static final Oid NT_GSS_KRB5_PRINCIPAL

Constructor Detail

GSSUtilback to summary
public GSSUtil()

Method Detail

createOidback to summary
public static Oid createOid(String oidStr)
debugback to summary
pack-priv static void debug(String message)
getMechStrback to summary
public static String getMechStr(Oid oid)
getSubjectback to summary
public static Subject getSubject(GSSName name, GSSCredential creds)

Note

The current impl only works with Sun's impl of GSSName and GSSCredential since it depends on package private APIs.

isKerberosMechback to summary
public static boolean isKerberosMech(Oid oid)
isSpNegoMechback to summary
public static boolean isSpNegoMech(Oid oid)
loginback to summary
public static Subject login(GSSCaller caller, Oid mech) throws LoginException

Authenticate using the login module from the specified configuration entry.

Parameters
caller:GSSCaller

the caller of JAAS Login

mech:Oid

the mech to be used

Returns:Subject

the authenticated subject

populateCredentialsback to summary
private static void populateCredentials(Set<Object> credentials, Set<?> gssCredentials)

Populates the set credentials with elements from gssCredentials. At the same time, it converts any subclasses of KerberosTicket into KerberosTicket instances and any subclasses of KerberosKey into KerberosKey instances. (It is not desirable to expose the customer to sun.security.jgss.krb5.Krb5InitCredential which extends KerberosTicket and sun.security.jgss.krb5.Kbr5AcceptCredential which extends KerberosKey.)

searchSubjectback to summary
public static <T extends GSSCredentialSpi> Vector<T> searchSubject(final GSSNameSpi name, final Oid mech, final boolean initiate, final Class<? extends T> credCls)

Searches the private credentials of current Subject with the specified criteria and returns the matching GSSCredentialSpi object out of Sun's impl of GSSCredential. Returns null if no Subject present or a Vector which contains 0 or more matching GSSCredentialSpi objects.

useMSInteropback to summary
public static boolean useMSInterop()

Determines the SPNEGO interoperability mode with Microsoft; by default it is set to true. To disable it, the application indicates this by explicitly setting the system property sun.security.spnego.interop to false.

useSubjectCredsOnlyback to summary
public static boolean useSubjectCredsOnly(GSSCaller caller)

Determines if the application doesn't mind if the mechanism obtains the required credentials from outside the current Subject. Our Kerberos v5 mechanism would do a JAAS login on behalf of the application if this were the case. The application indicates this by explicitly setting the system property javax.security.auth.useSubjectCredsOnly to false.