Package com.ongres.scram.client
Class ServerFirstProcessor
java.lang.Object
com.ongres.scram.client.ServerFirstProcessor
Process a received server-first-message. Generate by calling
.
invalid reference
ScramClient#receiveServerFirstMessage(String)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ClientFirstMessage
private final ScramMechanism
private final ServerFirstMessage
private final StringPreparation
-
Constructor Summary
ConstructorsConstructorDescriptionServerFirstProcessor
(ScramMechanism scramMechanism, StringPreparation stringPreparation, @NotNull String receivedServerFirstMessage, @NotNull String nonce, @NotNull ClientFirstMessage clientFirstMessage) -
Method Summary
Modifier and TypeMethodDescription(package private) ClientFinalProcessor
clientFinalProcessor
(byte[] saltedPassword) Generates aClientFinalProcessor
, that allows to generate the client-final-message and also receive and parse the server-first-message.(package private) ClientFinalProcessor
clientFinalProcessor
(byte[] clientKey, byte[] serverKey) Generates aClientFinalProcessor
, that allows to generate the client-final-message and also receive and parse the server-first-message.(package private) ClientFinalProcessor
clientFinalProcessor
(char[] password) Generates aClientFinalProcessor
, that allows to generate the client-final-message and also receive and parse the server-first-message.(package private) @NotNull ServerFirstMessage
-
Field Details
-
scramMechanism
-
stringPreparation
-
clientFirstMessage
-
serverFirstMessage
-
-
Constructor Details
-
ServerFirstProcessor
ServerFirstProcessor(ScramMechanism scramMechanism, StringPreparation stringPreparation, @NotNull @NotNull String receivedServerFirstMessage, @NotNull @NotNull String nonce, @NotNull @NotNull ClientFirstMessage clientFirstMessage) throws ScramParseException - Throws:
ScramParseException
-
-
Method Details
-
getServerFirstMessage
-
clientFinalProcessor
Generates aClientFinalProcessor
, that allows to generate the client-final-message and also receive and parse the server-first-message. It is based on the user's password.- Parameters:
password
- The user's password- Returns:
- The handler
- Throws:
IllegalArgumentException
- If the message is null or empty
-
clientFinalProcessor
Generates aClientFinalProcessor
, that allows to generate the client-final-message and also receive and parse the server-first-message. It is based on the clientKey and serverKey, which, if available, provide an optimized path versus providing the original user's password.- Parameters:
clientKey
- The client key, as per the SCRAM algorithm. It can be generated with:ScramFunctions.clientKey(ScramMechanism, byte[])
serverKey
- The server key, as per the SCRAM algorithm. It can be generated with:ScramFunctions.serverKey(ScramMechanism, byte[])
- Returns:
- The handler
- Throws:
IllegalArgumentException
- If the clientKey/serverKey is null
-
clientFinalProcessor
Generates aClientFinalProcessor
, that allows to generate the client-final-message and also receive and parse the server-first-message. It is based on the saltedPassword, which, if available, provide an optimized path versus providing the original user's password.- Parameters:
saltedPassword
- The salted password, as per the SCRAM algorithm. It can be generated with:ScramFunctions.saltedPassword(ScramMechanism, StringPreparation, char[], byte[], int)
- Returns:
- The handler
- Throws:
IllegalArgumentException
- If the saltedPassword is null
-