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_CONSTANT
private static byte[]
C2S_SIGN_CONSTANT
private static org.slf4j.Logger
logger
private java.util.List<com.hierynomus.asn1.types.primitive.ASN1ObjectIdentifier>
mechTypes
private byte[]
sealKey
private SecurityProvider
securityProvider
private java.util.concurrent.atomic.AtomicInteger
sequenceNumber
private byte[]
signKey
private NtlmAuthenticator
wrapped
-
Constructor Summary
Constructors Constructor Description NtlmSealer(NtlmAuthenticator wrapped)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthenticateResponse
authenticate(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)
void
init(SmbConfig config)
private byte[]
sign(byte[] signKey, int sequenceNumber)
boolean
supports(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:
authenticate
in 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:
init
in interfaceAuthenticator
-
supports
public boolean supports(AuthenticationContext context)
- Specified by:
supports
in interfaceAuthenticator
-
-