Package com.hierynomus.smbj.auth
Class SpnegoAuthenticator
java.lang.Object
com.hierynomus.smbj.auth.SpnegoAuthenticator
- All Implemented Interfaces:
Authenticator
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate GSSContext
private GSSContextConfig
private static final org.slf4j.Logger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate byte[]
adjustSessionKeyLength
(byte[] key) [MS-SMB2] 3.2.5.3.1 Handling a New Authentication Session.SessionKey MUST be set to the first 16 bytes of the cryptographic key queried from the GSS protocol for this authenticated context.authenticate
(AuthenticationContext context, byte[] gssToken, ConnectionContext connectionContext) private AuthenticateResponse
authenticateSession
(GSSAuthenticationContext context, byte[] gssToken, ConnectionContext connectionContext) void
boolean
supports
(AuthenticationContext context)
-
Field Details
-
logger
private static final org.slf4j.Logger logger -
gssContextConfig
-
gssContext
-
-
Constructor Details
-
SpnegoAuthenticator
public SpnegoAuthenticator()
-
-
Method Details
-
authenticate
public AuthenticateResponse authenticate(AuthenticationContext context, byte[] gssToken, ConnectionContext connectionContext) throws IOException - Specified by:
authenticate
in interfaceAuthenticator
- Throws:
IOException
-
authenticateSession
private AuthenticateResponse authenticateSession(GSSAuthenticationContext context, byte[] gssToken, ConnectionContext connectionContext) throws TransportException - Throws:
TransportException
-
adjustSessionKeyLength
private byte[] adjustSessionKeyLength(byte[] key) [MS-SMB2] 3.2.5.3.1 Handling a New Authentication Session.SessionKey MUST be set to the first 16 bytes of the cryptographic key queried from the GSS protocol for this authenticated context. If the cryptographic key is less than 16 bytes, it is right-padded with zero bytes.- Parameters:
key
- session key from the GSS API- Returns:
- key, truncated or padded to 16 bytes
-
init
- Specified by:
init
in interfaceAuthenticator
-
supports
- Specified by:
supports
in interfaceAuthenticator
-