Class ServerFirstProcessor


  • final class ServerFirstProcessor
    extends java.lang.Object
    Process a received server-first-message. Generate by calling ScramClient#receiveServerFirstMessage(String).
    • Method Detail

      • clientFinalProcessor

        ClientFinalProcessor clientFinalProcessor​(char[] password)
        Generates a 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

        ClientFinalProcessor clientFinalProcessor​(byte[] clientKey,
                                                  byte[] serverKey)
        Generates a 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 serverKey, 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, byte[])
        serverKey - The server key, as per the SCRAM algorithm. It can be generated with: ScramFunctions.serverKey(ScramMechanism, byte[])
        Returns:
        The handler
        Throws:
        java.lang.IllegalArgumentException - If the clientKey/serverKey is null
      • clientFinalProcessor

        ClientFinalProcessor clientFinalProcessor​(byte[] saltedPassword)
        Generates a ClientFinalProcessor, that allows to generate the client-final-message and also receive and parse the server-first-message. It is based on the saltedPassword, which, if available, provide an optimized path versus providing the original user's password.
        Parameters:
        saltedPassword - The salted password, as per the SCRAM algorithm. It can be generated with: ScramFunctions.saltedPassword(ScramMechanism, StringPreparation, char[], byte[], int)
        Returns:
        The handler
        Throws:
        java.lang.IllegalArgumentException - If the saltedPassword is null