Package org.wildfly.security.sasl.gssapi
Class GssapiClient
- java.lang.Object
-
- org.wildfly.security.sasl.util.AbstractSaslParticipant
-
- org.wildfly.security.sasl.gssapi.AbstractGssapiMechanism
-
- org.wildfly.security.sasl.gssapi.GssapiClient
-
- All Implemented Interfaces:
SaslClient,SaslWrapper
final class GssapiClient extends AbstractGssapiMechanism implements SaslClient
SaslClient for the GSSAPI mechanism as defined by RFC 4752- Author:
- Darran Lofthouse
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.wildfly.security.sasl.gssapi.AbstractGssapiMechanism
AbstractGssapiMechanism.GssapiWrapper, AbstractGssapiMechanism.QOP
-
-
Field Summary
Fields Modifier and Type Field Description private StringauthorizationIdprivate static intCHALLENGE_RESPONSE_STATEprivate static intINITIAL_CHALLENGE_STATEprivate static intSECURITY_LAYER_NEGOTIATION_STATE-
Fields inherited from class org.wildfly.security.sasl.gssapi.AbstractGssapiMechanism
actualMaxReceiveBuffer, configuredMaxReceiveBuffer, DEFAULT_MAX_BUFFER_SIZE, gssContext, maxBuffer, orderedQops, relaxComplianceChecks, selectedQop
-
Fields inherited from class org.wildfly.security.sasl.util.AbstractSaslParticipant
COMPLETE_STATE, FAILED_STATE, NO_BYTES
-
Fields inherited from interface org.wildfly.security.sasl.util.SaslWrapper
IDENTITY
-
-
Constructor Summary
Constructors Constructor Description GssapiClient(String protocol, String serverName, Map<String,?> props, CallbackHandler callbackHandler, String authorizationId)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static <T> TdoPrivileged(PrivilegedAction<T> action)byte[]evaluateChallenge(byte[] challenge)protected byte[]evaluateMessage(int state, byte[] message)private AbstractGssapiMechanism.QOPfindAgreeableQop(byte securityLayer)booleanhasInitialResponse()voidinit()private static byte[]initSecContext(GSSContext gssContext, byte[] inputBuf, int offset, int len)private booleanisCompatibleWithGssContext(AbstractGssapiMechanism.QOP qop)private booleanmayRequireSecurityLater(AbstractGssapiMechanism.QOP[] preferredQop)-
Methods inherited from class org.wildfly.security.sasl.gssapi.AbstractGssapiMechanism
dispose, getNegotiatedProperty, intToNetworkOrderBytes, networkOrderBytesToInt, parsePreferredQop
-
Methods inherited from class org.wildfly.security.sasl.util.AbstractSaslParticipant
assertComplete, evaluateMessage, getCallbackHandler, getIntProperty, getMechanismName, getProtocol, getServerName, getStringProperty, getWrapper, handleCallbacks, isComplete, negotiationComplete, setNegotiationState, setWrapper, tryHandleCallbacks, unwrap, wrap
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.security.sasl.SaslClient
dispose, getMechanismName, getNegotiatedProperty, isComplete, unwrap, wrap
-
-
-
-
Field Detail
-
INITIAL_CHALLENGE_STATE
private static final int INITIAL_CHALLENGE_STATE
- See Also:
- Constant Field Values
-
CHALLENGE_RESPONSE_STATE
private static final int CHALLENGE_RESPONSE_STATE
- See Also:
- Constant Field Values
-
SECURITY_LAYER_NEGOTIATION_STATE
private static final int SECURITY_LAYER_NEGOTIATION_STATE
- See Also:
- Constant Field Values
-
authorizationId
private final String authorizationId
-
-
Constructor Detail
-
GssapiClient
GssapiClient(String protocol, String serverName, Map<String,?> props, CallbackHandler callbackHandler, String authorizationId) throws SaslException
- Throws:
SaslException
-
-
Method Detail
-
mayRequireSecurityLater
private boolean mayRequireSecurityLater(AbstractGssapiMechanism.QOP[] preferredQop)
-
findAgreeableQop
private AbstractGssapiMechanism.QOP findAgreeableQop(byte securityLayer) throws SaslException
- Throws:
SaslException
-
isCompatibleWithGssContext
private boolean isCompatibleWithGssContext(AbstractGssapiMechanism.QOP qop)
-
init
public void init()
- Overrides:
initin classAbstractSaslParticipant
-
hasInitialResponse
public boolean hasInitialResponse()
- Specified by:
hasInitialResponsein interfaceSaslClient
-
evaluateChallenge
public byte[] evaluateChallenge(byte[] challenge) throws SaslException- Specified by:
evaluateChallengein interfaceSaslClient- Throws:
SaslException
-
evaluateMessage
protected byte[] evaluateMessage(int state, byte[] message) throws SaslException- Specified by:
evaluateMessagein classAbstractSaslParticipant- Throws:
SaslException
-
initSecContext
private static byte[] initSecContext(GSSContext gssContext, byte[] inputBuf, int offset, int len) throws GSSException
- Throws:
GSSException
-
doPrivileged
private static <T> T doPrivileged(PrivilegedAction<T> action)
-
-