Package org.ldaptive.transport
Class ScramSaslClient
- java.lang.Object
-
- org.ldaptive.transport.ScramSaslClient
-
- All Implemented Interfaces:
SaslClient<ScramBindRequest>
public class ScramSaslClient extends Object implements SaslClient<ScramBindRequest>
SASL client that implements the SCRAM protocol. See RFC 5802.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
ScramSaslClient.ClientFinalMessage
Properties associated with the final client message.(package private) static class
ScramSaslClient.ClientFirstMessage
Properties associated with the client first message.(package private) static class
ScramSaslClient.ServerFinalMessage
Verifies the final server message.(package private) static class
ScramSaslClient.ServerFirstMessage
Properties associated with the first server response.
-
Constructor Summary
Constructors Constructor Description ScramSaslClient()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BindResponse
bind(TransportConnection conn, ScramBindRequest request)
Performs a SCRAM SASL bind.private static byte[]
createDigest(String algorithm, byte[] data)
Digests the supplied data using the supplied algorithm.private static Mac
createMac(String algorithm, byte[] key)
Creates a new MAC using the supplied algorithm and key.
-
-
-
Field Detail
-
LOGGER
private static final Logger LOGGER
Logger for this class.
-
-
Method Detail
-
bind
public BindResponse bind(TransportConnection conn, ScramBindRequest request) throws LdapException
Performs a SCRAM SASL bind.- Specified by:
bind
in interfaceSaslClient<ScramBindRequest>
- Parameters:
conn
- to perform the bind onrequest
- SASL request to perform- Returns:
- final result of the bind process
- Throws:
LdapException
- if an error occurs
-
createMac
private static Mac createMac(String algorithm, byte[] key)
Creates a new MAC using the supplied algorithm and key.- Parameters:
algorithm
- of the MACkey
- to seed the MAC- Returns:
- new mac
-
createDigest
private static byte[] createDigest(String algorithm, byte[] data)
Digests the supplied data using the supplied algorithm.- Parameters:
algorithm
- of the digestdata
- to digest- Returns:
- digested data
-
-