Package com.ongres.scram.client
Class ScramSession.ClientFinalProcessor
- java.lang.Object
-
- com.ongres.scram.client.ScramSession.ClientFinalProcessor
-
- Enclosing class:
- ScramSession
public class ScramSession.ClientFinalProcessor extends java.lang.ObjectProcessor 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 eitherScramSession.ServerFirstProcessor.clientFinalProcessor(String)orScramSession.ServerFirstProcessor.clientFinalProcessor(byte[], byte[]).
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringauthMessageprivate byte[]clientKeyprivate java.lang.Stringnonceprivate byte[]serverKeyprivate byte[]storedKey
-
Constructor Summary
Constructors Modifier Constructor Description privateClientFinalProcessor(java.lang.String nonce, byte[] saltedPassword)privateClientFinalProcessor(java.lang.String nonce, byte[] clientKey, byte[] serverKey)privateClientFinalProcessor(java.lang.String nonce, byte[] clientKey, byte[] storedKey, byte[] serverKey)privateClientFinalProcessor(java.lang.String nonce, java.lang.String password, java.lang.String salt, int iteration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringclientFinalMessage()Generates the SCRAM representation of the client-final-message.private java.lang.StringclientFinalMessage(byte[] cbindData)Generates the SCRAM representation of the client-final-message, including the given channel-binding data.private voidgenerateAndCacheAuthMessage(byte[] cbindData)voidreceiveServerFinalMessage(java.lang.String serverFinalMessage)Receive and process the server-final-message.
-
-
-
Constructor Detail
-
ClientFinalProcessor
private ClientFinalProcessor(java.lang.String nonce, byte[] clientKey, byte[] storedKey, byte[] serverKey)
-
ClientFinalProcessor
private ClientFinalProcessor(java.lang.String nonce, byte[] clientKey, byte[] serverKey)
-
ClientFinalProcessor
private ClientFinalProcessor(java.lang.String nonce, byte[] saltedPassword)
-
ClientFinalProcessor
private ClientFinalProcessor(java.lang.String nonce, java.lang.String password, java.lang.String salt, int iteration)
-
-
Method Detail
-
generateAndCacheAuthMessage
private void generateAndCacheAuthMessage(byte[] cbindData)
-
clientFinalMessage
private java.lang.String clientFinalMessage(byte[] cbindData) throws java.lang.IllegalArgumentExceptionGenerates 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:
java.lang.IllegalArgumentException- If the channel binding data is null
-
clientFinalMessage
public java.lang.String clientFinalMessage()
Generates the SCRAM representation of the client-final-message.- Returns:
- The message
-
receiveServerFinalMessage
public void receiveServerFinalMessage(java.lang.String serverFinalMessage) throws ScramParseException, ScramServerErrorException, ScramInvalidServerSignatureException, java.lang.IllegalArgumentExceptionReceive 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 errorjava.lang.IllegalArgumentException- If the message is null or emptyScramInvalidServerSignatureException
-
-