Package com.ongres.scram.client
Class ClientFinalProcessor
- java.lang.Object
-
- com.ongres.scram.client.ClientFinalProcessor
-
final class ClientFinalProcessor extends java.lang.Object
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 eitherServerFirstProcessor#clientFinalProcessor(char[])
orServerFirstProcessor#clientFinalProcessor(byte[], byte[])
.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
authMessage
private ClientFirstMessage
clientFirstMessage
private byte[]
clientKey
private ScramMechanism
scramMechanism
private ServerFirstMessage
serverFirstMessage
private byte[]
serverKey
private byte[]
storedKey
-
Constructor Summary
Constructors Modifier Constructor Description private
ClientFinalProcessor(ScramMechanism scramMechanism, byte[] clientKey, byte[] storedKey, byte[] serverKey, ClientFirstMessage clientFirstMessage, ServerFirstMessage serverFirstMessage)
(package private)
ClientFinalProcessor(ScramMechanism scramMechanism, byte[] clientKey, byte[] serverKey, ClientFirstMessage clientFirstMessage, ServerFirstMessage serverFirstMessage)
(package private)
ClientFinalProcessor(ScramMechanism scramMechanism, byte[] saltedPassword, ClientFirstMessage clientFirstMessage, ServerFirstMessage serverFirstMessage)
(package private)
ClientFinalProcessor(ScramMechanism scramMechanism, StringPreparation stringPreparation, char[] password, byte[] salt, ClientFirstMessage clientFirstMessage, ServerFirstMessage serverFirstMessage)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) @NotNull ClientFinalMessage
clientFinalMessage(byte @Nullable [] cbindData)
Generates the SCRAM representation of the client-final-message, including the given channel-binding data.private void
generateAndCacheAuthMessage(byte[] cbindData)
(package private) @NotNull ServerFinalMessage
receiveServerFinalMessage(@NotNull java.lang.String serverFinalMessage)
Receive and process the server-final-message.
-
-
-
Field Detail
-
clientKey
private final byte[] clientKey
-
storedKey
private final byte[] storedKey
-
serverKey
private final byte[] serverKey
-
scramMechanism
private final ScramMechanism scramMechanism
-
clientFirstMessage
private final ClientFirstMessage clientFirstMessage
-
serverFirstMessage
private final ServerFirstMessage serverFirstMessage
-
authMessage
private java.lang.String authMessage
-
-
Constructor Detail
-
ClientFinalProcessor
private ClientFinalProcessor(ScramMechanism scramMechanism, byte[] clientKey, byte[] storedKey, byte[] serverKey, ClientFirstMessage clientFirstMessage, ServerFirstMessage serverFirstMessage)
-
ClientFinalProcessor
ClientFinalProcessor(ScramMechanism scramMechanism, byte[] clientKey, byte[] serverKey, ClientFirstMessage clientFirstMessage, ServerFirstMessage serverFirstMessage)
-
ClientFinalProcessor
ClientFinalProcessor(ScramMechanism scramMechanism, byte[] saltedPassword, ClientFirstMessage clientFirstMessage, ServerFirstMessage serverFirstMessage)
-
ClientFinalProcessor
ClientFinalProcessor(ScramMechanism scramMechanism, StringPreparation stringPreparation, char[] password, byte[] salt, ClientFirstMessage clientFirstMessage, ServerFirstMessage serverFirstMessage)
-
-
Method Detail
-
generateAndCacheAuthMessage
private void generateAndCacheAuthMessage(byte[] cbindData)
-
clientFinalMessage
@NotNull @NotNull ClientFinalMessage clientFinalMessage(byte @Nullable [] cbindData)
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
-
receiveServerFinalMessage
@NotNull @NotNull ServerFinalMessage receiveServerFinalMessage(@NotNull @NotNull java.lang.String serverFinalMessage) throws ScramParseException, ScramServerErrorException, ScramInvalidServerSignatureException
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 errorScramInvalidServerSignatureException
- If the server signature is invalidjava.lang.IllegalArgumentException
- If the message is null or empty
-
-