Class ClientFinalProcessor
java.lang.Object
com.ongres.scram.client.ClientFinalProcessor
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
ServerFirstProcessor#clientFinalProcessor(char[]) or
ServerFirstProcessor#clientFinalProcessor(byte[], byte[]).-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate final ClientFirstMessageprivate final byte[]private final ScramMechanismprivate final ServerFirstMessageprivate final byte[]private final byte[] -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateClientFinalProcessor(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
Modifier and TypeMethodDescription(package private) @NotNull ClientFinalMessageclientFinalMessage(byte @Nullable [] cbindData) Generates the SCRAM representation of the client-final-message, including the given channel-binding data.private voidgenerateAndCacheAuthMessage(byte[] cbindData) (package private) @NotNull ServerFinalMessagereceiveServerFinalMessage(@NotNull String serverFinalMessage) Receive and process the server-final-message.
-
Field Details
-
clientKey
private final byte[] clientKey -
storedKey
private final byte[] storedKey -
serverKey
private final byte[] serverKey -
scramMechanism
-
clientFirstMessage
-
serverFirstMessage
-
authMessage
-
-
Constructor Details
-
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 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
-
receiveServerFinalMessage
@NotNull @NotNull ServerFinalMessage receiveServerFinalMessage(@NotNull @NotNull 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 invalidIllegalArgumentException- If the message is null or empty
-