Package com.ongres.scram.client
Class ScramSession.ServerFirstProcessor
- java.lang.Object
-
- com.ongres.scram.client.ScramSession.ServerFirstProcessor
-
- Enclosing class:
- ScramSession
public class ScramSession.ServerFirstProcessor extends java.lang.ObjectProcess a received server-first-message. Generate by callingScramSession.receiveServerFirstMessage(String).
-
-
Field Summary
Fields Modifier and Type Field Description private ServerFirstMessageserverFirstMessage
-
Constructor Summary
Constructors Modifier Constructor Description privateServerFirstProcessor(java.lang.String receivedServerFirstMessage)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ScramSession.ClientFinalProcessorclientFinalProcessor(byte[] clientKey, byte[] storedKey)Generates aScramSession.ClientFinalProcessor, that allows to generate the client-final-message and also receive and parse the server-first-message.ScramSession.ClientFinalProcessorclientFinalProcessor(java.lang.String password)Generates aScramSession.ClientFinalProcessor, that allows to generate the client-final-message and also receive and parse the server-first-message.intgetIteration()java.lang.StringgetSalt()
-
-
-
Field Detail
-
serverFirstMessage
private final ServerFirstMessage serverFirstMessage
-
-
Constructor Detail
-
ServerFirstProcessor
private ServerFirstProcessor(java.lang.String receivedServerFirstMessage) throws ScramParseException- Throws:
ScramParseException
-
-
Method Detail
-
getSalt
public java.lang.String getSalt()
-
getIteration
public int getIteration()
-
clientFinalProcessor
public ScramSession.ClientFinalProcessor clientFinalProcessor(java.lang.String password) throws java.lang.IllegalArgumentException
Generates aScramSession.ClientFinalProcessor, 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:
java.lang.IllegalArgumentException- If the message is null or empty
-
clientFinalProcessor
public ScramSession.ClientFinalProcessor clientFinalProcessor(byte[] clientKey, byte[] storedKey) throws java.lang.IllegalArgumentException
Generates aScramSession.ClientFinalProcessor, that allows to generate the client-final-message and also receive and parse the server-first-message. It is based on the clientKey and storedKey, 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, StringPreparation, String, byte[], int)storedKey- The stored key, as per the SCRAM algorithm. It can be generated from the client key with:ScramFunctions.storedKey(ScramMechanism, byte[])- Returns:
- The handler
- Throws:
java.lang.IllegalArgumentException- If the message is null or empty
-
-