Package com.hierynomus.smbj.auth
Class NtlmSealer
- java.lang.Object
-
- com.hierynomus.smbj.auth.NtlmSealer
-
- All Implemented Interfaces:
Authenticator
public class NtlmSealer extends java.lang.Object implements Authenticator
-
-
Field Summary
Fields Modifier and Type Field Description private static byte[]C2S_SEAL_CONSTANTprivate static byte[]C2S_SIGN_CONSTANTprivate static org.slf4j.Loggerloggerprivate java.util.List<com.hierynomus.asn1.types.primitive.ASN1ObjectIdentifier>mechTypesprivate byte[]sealKeyprivate SecurityProvidersecurityProviderprivate java.util.concurrent.atomic.AtomicIntegersequenceNumberprivate byte[]signKeyprivate NtlmAuthenticatorwrapped
-
Constructor Summary
Constructors Constructor Description NtlmSealer(NtlmAuthenticator wrapped)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthenticateResponseauthenticate(AuthenticationContext context, byte[] gssToken, ConnectionContext connectionContext)private byte[]derBytes(java.util.List<com.hierynomus.asn1.types.primitive.ASN1ObjectIdentifier> mechTypes)private byte[]deriveSealingKey(byte[] sessionKey, java.util.Set<NtlmNegotiateFlag> negotiateFlags, WindowsVersion windowsVersion)private byte[]deriveSigningKey(byte[] sessionKey, java.util.Set<NtlmNegotiateFlag> negotiateFlags)voidinit(SmbConfig config)private byte[]sign(byte[] signKey, int sequenceNumber)booleansupports(AuthenticationContext context)private byte[]uint32(int value)
-
-
-
Field Detail
-
logger
private static final org.slf4j.Logger logger
-
C2S_SIGN_CONSTANT
private static final byte[] C2S_SIGN_CONSTANT
-
C2S_SEAL_CONSTANT
private static final byte[] C2S_SEAL_CONSTANT
-
wrapped
private NtlmAuthenticator wrapped
-
securityProvider
private SecurityProvider securityProvider
-
signKey
private byte[] signKey
-
sealKey
private byte[] sealKey
-
sequenceNumber
private java.util.concurrent.atomic.AtomicInteger sequenceNumber
-
mechTypes
private java.util.List<com.hierynomus.asn1.types.primitive.ASN1ObjectIdentifier> mechTypes
-
-
Constructor Detail
-
NtlmSealer
public NtlmSealer(NtlmAuthenticator wrapped)
-
-
Method Detail
-
authenticate
public AuthenticateResponse authenticate(AuthenticationContext context, byte[] gssToken, ConnectionContext connectionContext) throws java.io.IOException
- Specified by:
authenticatein interfaceAuthenticator- Throws:
java.io.IOException
-
sign
private byte[] sign(byte[] signKey, int sequenceNumber) throws java.io.IOException- Throws:
java.io.IOException
-
uint32
private byte[] uint32(int value)
-
derBytes
private byte[] derBytes(java.util.List<com.hierynomus.asn1.types.primitive.ASN1ObjectIdentifier> mechTypes) throws java.io.IOException- Throws:
java.io.IOException
-
deriveSigningKey
private byte[] deriveSigningKey(byte[] sessionKey, java.util.Set<NtlmNegotiateFlag> negotiateFlags)
-
deriveSealingKey
private byte[] deriveSealingKey(byte[] sessionKey, java.util.Set<NtlmNegotiateFlag> negotiateFlags, WindowsVersion windowsVersion)
-
init
public void init(SmbConfig config)
- Specified by:
initin interfaceAuthenticator
-
supports
public boolean supports(AuthenticationContext context)
- Specified by:
supportsin interfaceAuthenticator
-
-