Package org.ldaptive.transport
Class ScramSaslClient.ClientFinalMessage
java.lang.Object
org.ldaptive.transport.ScramSaslClient.ClientFinalMessage
- Enclosing class:
- ScramSaslClient
Properties associated with the final client message.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final byte[]
Bytes for the client key hmac.private static final String
GS2 header for no channel binding.private static final byte[]
4-octet encoding of the integer 1.private final Mechanism
Scram SASL mechanism.private final String
Client first message plus the server first message plus the withoutProof string.private final byte[]
Computed password using the server salt and iterations.private final String
Channel binding attribute plus the combined nonce. -
Constructor Summary
ConstructorsConstructorDescriptionClientFinalMessage
(Mechanism mech, String password, ScramSaslClient.ClientFirstMessage clientFirstMessage, ScramSaslClient.ServerFirstMessage serverFirstMessage) Creates a new client final message. -
Method Summary
Modifier and TypeMethodDescriptionprivate static byte[]
createSaltedPassword
(String algorithm, String password, byte[] salt, int iterations) Computes a salted password.encode()
Encodes this message to send to the server.byte[]
-
Field Details
-
GS2_NO_CHANNEL_BINDING
GS2 header for no channel binding. -
INTEGER_ONE
private static final byte[] INTEGER_ONE4-octet encoding of the integer 1. -
CLIENT_KEY_INIT
private static final byte[] CLIENT_KEY_INITBytes for the client key hmac. -
mechanism
Scram SASL mechanism. -
withoutProof
Channel binding attribute plus the combined nonce. -
message
Client first message plus the server first message plus the withoutProof string. -
saltedPassword
private final byte[] saltedPasswordComputed password using the server salt and iterations.
-
-
Constructor Details
-
ClientFinalMessage
ClientFinalMessage(Mechanism mech, String password, ScramSaslClient.ClientFirstMessage clientFirstMessage, ScramSaslClient.ServerFirstMessage serverFirstMessage) Creates a new client final message.- Parameters:
mech
- scram mechanismpassword
- to authenticate the user withclientFirstMessage
- first message sent to the serverserverFirstMessage
- first response from the server
-
-
Method Details
-
getSaltedPassword
public byte[] getSaltedPassword() -
getMessage
-
encode
Encodes this message to send to the server. Concatenation of the message without proof and the proof.- Returns:
- encoded message
-
createSaltedPassword
private static byte[] createSaltedPassword(String algorithm, String password, byte[] salt, int iterations) Computes a salted password.- Parameters:
algorithm
- of the MACpassword
- to seed the MAC withsalt
- for the MACiterations
- of the MAC- Returns:
- salted password
-