Package org.globus.gsi.gssapi
Class JaasGssUtil
- java.lang.Object
-
- org.globus.gsi.gssapi.JaasGssUtil
-
public class JaasGssUtil extends java.lang.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 javax.security.auth.Subject
createSubject(org.ietf.jgss.GSSCredential cred)
Creates a newSubject
object from specifiedGSSCredential
.static javax.security.auth.Subject
createSubject(org.ietf.jgss.GSSName name, org.ietf.jgss.GSSCredential cred)
Creates a newSubject
object from specifiedGSSCredential
andGSSName
.static org.ietf.jgss.GSSCredential
getCredential(javax.security.auth.Subject subject)
Retrieves the firstGSSCredential
from the private credential set of the specifiedSubject
object.static GlobusPrincipal
toGlobusPrincipal(org.ietf.jgss.GSSName name)
Converts the specified GSSName to GlobusPrincipal.
-
-
-
Method Detail
-
createSubject
public static javax.security.auth.Subject createSubject(org.ietf.jgss.GSSCredential cred) throws org.ietf.jgss.GSSException
Creates a newSubject
object 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.GlobusGSSName
aorg.globus.gsi.jaas.GlobusPrincipal
is added to the principals set of the Subject object.- Throws:
org.ietf.jgss.GSSException
-
createSubject
public static javax.security.auth.Subject createSubject(org.ietf.jgss.GSSName name, org.ietf.jgss.GSSCredential cred) throws org.ietf.jgss.GSSException
Creates a newSubject
object from specifiedGSSCredential
andGSSName
. 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.GlobusGSSName
and the GSSName parameter was not specified aorg.globus.gsi.jaas.GlobusPrincipal
is added to the principals set of the Subject object. If the GSSName parameter was specified of typeorg.globus.gsi.gssapi.GlobusGSSName
aorg.globus.gsi.jaas.GlobusPrincipal
is added to the principals set of the Subject object.- Throws:
org.ietf.jgss.GSSException
-
toGlobusPrincipal
public static GlobusPrincipal toGlobusPrincipal(org.ietf.jgss.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.GlobusGSSName
and the name is not anonymous.
-
getCredential
public static org.ietf.jgss.GSSCredential getCredential(javax.security.auth.Subject subject)
Retrieves the firstGSSCredential
from the private credential set of the specifiedSubject
object.- Returns:
- the
GSSCredential
. Might be null.
-
-