Package org.wildfly.security.sasl.gs2
Class Gs2SaslServer
- java.lang.Object
-
- org.wildfly.security.sasl.util.AbstractSaslParticipant
-
- org.wildfly.security.sasl.util.AbstractSaslServer
-
- org.wildfly.security.sasl.gs2.Gs2SaslServer
-
- All Implemented Interfaces:
SaslServer
,SaslWrapper
final class Gs2SaslServer extends AbstractSaslServer
SaslServer for the GS2 mechanism family as defined by RFC 5801.- Author:
- Farah Juma
-
-
Field Summary
Fields Modifier and Type Field Description private String
authorizationID
private byte[]
bindingData
private String
bindingType
private String
boundServerName
private GSSContext
gssContext
private Oid
mechanism
private boolean
plus
private static int
ST_ACCEPTOR
private static int
ST_FIRST_MESSAGE
private static int
ST_NO_MESSAGE
-
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 Gs2SaslServer(String mechanismName, String protocol, String serverName, CallbackHandler callbackHandler, GSSManager gssManager, boolean plus, String bindingType, byte[] bindingData)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
checkAuthorizationID()
void
dispose()
Dispose of this participant.protected byte[]
evaluateMessage(int state, byte[] message)
String
getAuthorizationID()
Object
getNegotiatedProperty(String propName)
Get a property negotiated between this participant and the other.void
init()
private byte[]
restoreTokenHeader(byte[] token)
Recompute and restore the initial context token header for the given token.private void
skipDelimiter(org.wildfly.common.iteration.ByteIterator bi)
private void
storeBoundServerName()
private void
storeDelegatedGSSCredential()
-
Methods inherited from class org.wildfly.security.sasl.util.AbstractSaslServer
evaluateResponse
-
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.SaslServer
getMechanismName, isComplete, unwrap, wrap
-
-
-
-
Field Detail
-
ST_NO_MESSAGE
private static final int ST_NO_MESSAGE
- See Also:
- Constant Field Values
-
ST_FIRST_MESSAGE
private static final int ST_FIRST_MESSAGE
- See Also:
- Constant Field Values
-
ST_ACCEPTOR
private static final int ST_ACCEPTOR
- See Also:
- Constant Field Values
-
plus
private final boolean plus
-
bindingType
private final String bindingType
-
bindingData
private final byte[] bindingData
-
mechanism
private final Oid mechanism
-
gssContext
private GSSContext gssContext
-
authorizationID
private String authorizationID
-
boundServerName
private String boundServerName
-
-
Constructor Detail
-
Gs2SaslServer
Gs2SaslServer(String mechanismName, String protocol, String serverName, CallbackHandler callbackHandler, GSSManager gssManager, boolean plus, String bindingType, byte[] bindingData) throws SaslException
- Throws:
SaslException
-
-
Method Detail
-
init
public void init()
- Overrides:
init
in classAbstractSaslParticipant
-
getAuthorizationID
public String getAuthorizationID()
-
evaluateMessage
protected byte[] evaluateMessage(int state, byte[] message) throws SaslException
- Specified by:
evaluateMessage
in classAbstractSaslParticipant
- Throws:
SaslException
-
dispose
public void dispose() throws SaslException
Description copied from class:AbstractSaslParticipant
Dispose of this participant.- Specified by:
dispose
in interfaceSaslServer
- Overrides:
dispose
in classAbstractSaslParticipant
- Throws:
SaslException
- if disposal failed
-
restoreTokenHeader
private byte[] restoreTokenHeader(byte[] token) throws ASN1Exception
Recompute and restore the initial context token header for the given token.- Parameters:
token
- the initial context token without the token header- Returns:
- the initial context token with the token header restored
- Throws:
ASN1Exception
- if the mechanism OID cannot be DER encoded
-
storeBoundServerName
private void storeBoundServerName() throws SaslException
- Throws:
SaslException
-
checkAuthorizationID
private void checkAuthorizationID() throws SaslException
- Throws:
SaslException
-
storeDelegatedGSSCredential
private void storeDelegatedGSSCredential() throws SaslException
- Throws:
SaslException
-
skipDelimiter
private void skipDelimiter(org.wildfly.common.iteration.ByteIterator bi) throws SaslException
- Throws:
SaslException
-
getNegotiatedProperty
public Object getNegotiatedProperty(String propName)
Description copied from class:AbstractSaslParticipant
Get a property negotiated between this participant and the other.- Specified by:
getNegotiatedProperty
in interfaceSaslServer
- Overrides:
getNegotiatedProperty
in classAbstractSaslParticipant
- Parameters:
propName
- the property name- Returns:
- the property value or
null
if not defined
-
-