public final class ServerFirstMessage extends Object
server-first-messages.
| nonce | "r=" c-nonce [s-nonce] ;; Second part provided by server. |
| salt | "s=" base64 |
| server-first-message | [reserved-mext ","] nonce "," salt ", "iteration-count ["," extensions] |
| Constructor and Description |
|---|
ServerFirstMessage(@NotNull String clientNonce,
@NotNull String serverNonce,
@NotNull String salt,
int iterationCount)
Constructs a server-first-message from a client-first-message and the additional required data.
|
| Modifier and Type | Method and Description |
|---|---|
@NotNull String |
getClientNonce()
The client nonce.
|
int |
getIterationCount()
The number of iterations.
|
@NotNull String |
getNonce()
The concatenation of the client nonce and the server nonce:
c-nonce [s-nonce]. |
String |
getSalt()
The salt in base64.
|
@NotNull String |
getServerNonce()
The server nonce.
|
static @NotNull ServerFirstMessage |
parseFrom(@NotNull String serverFirstMessage,
@NotNull String clientNonce)
Parses a server-first-message from a String.
|
@NotNull String |
toString()
String representation of the SCRAM message.
|
public ServerFirstMessage(@NotNull
@NotNull String clientNonce,
@NotNull
@NotNull String serverNonce,
@NotNull
@NotNull String salt,
int iterationCount)
| server-error | "e=" server-error-value |
| verifier | "v=" base64 ;; base-64 encoded ServerSignature. |
| server-final-message | (server-error / verifier) ["," extensions] |
clientNonce - The c-nonce used in client-first-messageserverNonce - The s-nonce returned by the serversalt - The saltiterationCount - The iteration count (must be positive)IllegalArgumentException - If clientFirstMessage, serverNonce or salt are null or empty,
or iteration < 1@NotNull public @NotNull String getClientNonce()
@NotNull public @NotNull String getServerNonce()
@NotNull public @NotNull String getNonce()
c-nonce [s-nonce].public String getSalt()
public int getIterationCount()
@NotNull public static @NotNull ServerFirstMessage parseFrom(@NotNull @NotNull String serverFirstMessage, @NotNull @NotNull String clientNonce) throws ScramParseException
serverFirstMessage - The string representing the server-first-messageclientNonce - The clientNonce that is present in the client-first-messageScramParseException - If the argument is not a valid server-first-messageIllegalArgumentException - If either argument is empty or serverFirstMessage is not a
valid messageCopyright © 2017–2025 OnGres, Inc. All rights reserved.