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 StringauthorizationIDprivate byte[]bindingDataprivate StringbindingTypeprivate StringboundServerNameprivate GSSContextgssContextprivate Oidmechanismprivate booleanplusprivate static intST_ACCEPTORprivate static intST_FIRST_MESSAGEprivate static intST_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 voidcheckAuthorizationID()voiddispose()Dispose of this participant.protected byte[]evaluateMessage(int state, byte[] message)StringgetAuthorizationID()ObjectgetNegotiatedProperty(String propName)Get a property negotiated between this participant and the other.voidinit()private byte[]restoreTokenHeader(byte[] token)Recompute and restore the initial context token header for the given token.private voidskipDelimiter(org.wildfly.common.iteration.ByteIterator bi)private voidstoreBoundServerName()private voidstoreDelegatedGSSCredential()-
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:
initin classAbstractSaslParticipant
-
getAuthorizationID
public String getAuthorizationID()
-
evaluateMessage
protected byte[] evaluateMessage(int state, byte[] message) throws SaslException- Specified by:
evaluateMessagein classAbstractSaslParticipant- Throws:
SaslException
-
dispose
public void dispose() throws SaslExceptionDescription copied from class:AbstractSaslParticipantDispose of this participant.- Specified by:
disposein interfaceSaslServer- Overrides:
disposein classAbstractSaslParticipant- Throws:
SaslException- if disposal failed
-
restoreTokenHeader
private byte[] restoreTokenHeader(byte[] token) throws ASN1ExceptionRecompute 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:AbstractSaslParticipantGet a property negotiated between this participant and the other.- Specified by:
getNegotiatedPropertyin interfaceSaslServer- Overrides:
getNegotiatedPropertyin classAbstractSaslParticipant- Parameters:
propName- the property name- Returns:
- the property value or
nullif not defined
-
-