Package com.ongres.scram.client
Class ScramSession.ClientFinalProcessor
java.lang.Object
com.ongres.scram.client.ScramSession.ClientFinalProcessor
- Enclosing class:
ScramSession
Processor that allows to generate the client-final-message,
as well as process the server-final-message and verify server's signature.
Generate the processor by calling either
ScramSession.ServerFirstProcessor.clientFinalProcessor(String)
or ScramSession.ServerFirstProcessor.clientFinalProcessor(byte[], byte[]).-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateClientFinalProcessor(String nonce, byte[] saltedPassword) privateClientFinalProcessor(String nonce, byte[] clientKey, byte[] serverKey) privateClientFinalProcessor(String nonce, byte[] clientKey, byte[] storedKey, byte[] serverKey) privateClientFinalProcessor(String nonce, String password, String salt, int iteration) -
Method Summary
Modifier and TypeMethodDescriptionGenerates the SCRAM representation of the client-final-message.private StringclientFinalMessage(byte[] cbindData) Generates the SCRAM representation of the client-final-message, including the given channel-binding data.private voidgenerateAndCacheAuthMessage(byte[] cbindData) voidreceiveServerFinalMessage(String serverFinalMessage) Receive and process the server-final-message.
-
Field Details
-
nonce
-
clientKey
private final byte[] clientKey -
storedKey
private final byte[] storedKey -
serverKey
private final byte[] serverKey -
authMessage
-
-
Constructor Details
-
ClientFinalProcessor
-
ClientFinalProcessor
-
ClientFinalProcessor
-
ClientFinalProcessor
-
-
Method Details
-
generateAndCacheAuthMessage
private void generateAndCacheAuthMessage(byte[] cbindData) -
clientFinalMessage
Generates the SCRAM representation of the client-final-message, including the given channel-binding data.- Parameters:
cbindData- The bytes of the channel-binding data- Returns:
- The message
- Throws:
IllegalArgumentException- If the channel binding data is null
-
clientFinalMessage
Generates the SCRAM representation of the client-final-message.- Returns:
- The message
-
receiveServerFinalMessage
public void receiveServerFinalMessage(String serverFinalMessage) throws ScramParseException, ScramServerErrorException, ScramInvalidServerSignatureException, IllegalArgumentException Receive and process the server-final-message. Server SCRAM signatures is verified.- Parameters:
serverFinalMessage- The received server-final-message- Throws:
ScramParseException- If the message is not a valid server-final-messageScramServerErrorException- If the server-final-message contained an errorIllegalArgumentException- If the message is null or emptyScramInvalidServerSignatureException
-