Package org.globus.gsi.gssapi
Class JaasGssUtil
- java.lang.Object
-
- org.globus.gsi.gssapi.JaasGssUtil
-
public class JaasGssUtil extends Object
An utility class for handling JAAS Subject with GSSCredential.
-
-
Constructor Summary
Constructors Constructor Description JaasGssUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SubjectcreateSubject(GSSCredential cred)Creates a newSubjectobject from specifiedGSSCredential.static SubjectcreateSubject(GSSName name, GSSCredential cred)Creates a newSubjectobject from specifiedGSSCredentialandGSSName.static GSSCredentialgetCredential(Subject subject)Retrieves the firstGSSCredentialfrom the private credential set of the specifiedSubjectobject.static GlobusPrincipaltoGlobusPrincipal(GSSName name)Converts the specified GSSName to GlobusPrincipal.
-
-
-
Method Detail
-
createSubject
public static Subject createSubject(GSSCredential cred) throws GSSException
Creates a newSubjectobject from specifiedGSSCredential. The GSSCredential is added to the private credential set of the Subject object. Also, if the GSSCredential.getName() is of typeorg.globus.gsi.gssapi.GlobusGSSNameaorg.globus.gsi.jaas.GlobusPrincipalis added to the principals set of the Subject object.- Throws:
GSSException
-
createSubject
public static Subject createSubject(GSSName name, GSSCredential cred) throws GSSException
Creates a newSubjectobject from specifiedGSSCredentialandGSSName. If the GSSCredential is specified it is added to the private credential set of the Subject object. Also, if the GSSCredential.getName() is of typeorg.globus.gsi.gssapi.GlobusGSSNameand the GSSName parameter was not specified aorg.globus.gsi.jaas.GlobusPrincipalis added to the principals set of the Subject object. If the GSSName parameter was specified of typeorg.globus.gsi.gssapi.GlobusGSSNameaorg.globus.gsi.jaas.GlobusPrincipalis added to the principals set of the Subject object.- Throws:
GSSException
-
toGlobusPrincipal
public static GlobusPrincipal toGlobusPrincipal(GSSName name)
Converts the specified GSSName to GlobusPrincipal. The GSSName is converted into the GlobusPrincipal only if the GSSName is of typeorg.globus.gsi.gssapi.GlobusGSSNameand the name is not anonymous.
-
getCredential
public static GSSCredential getCredential(Subject subject)
Retrieves the firstGSSCredentialfrom the private credential set of the specifiedSubjectobject.- Returns:
- the
GSSCredential. Might be null.
-
-