public final class ServerFinalMessage extends Object
server-final-messages.
| server-error | "e=" server-error-value |
| server-error-value | "invalid-encoding" / "extensions-not-supported" / ; unrecognized 'm' value "invalid-proof" / "channel-bindings-dont-match" / "server-does-support-channel-binding" / ; server does not support channel binding "channel-binding-not-supported" / "unsupported-channel-binding-type" / "unknown-user" / "invalid-username-encoding" / ; invalid username encoding (invalid UTF-8 or ; SASLprep failed) "no-resources" / "other-error" ; Unrecognized errors should be treated as "other-error". ; In order to prevent information disclosure, the server ; may substitute the real reason with "other-error". |
| verifier | "v=" base64 ;; base-64 encoded ServerSignature. |
| server-final-message | (server-error / verifier) ["," extensions] |
| Constructor and Description |
|---|
ServerFinalMessage(byte[] verifier)
Constructs a server-final-message with no errors, and the provided server verifier.
|
ServerFinalMessage(@NotNull String serverError)
Constructs a server-final-message which represents a SCRAM error.
|
| Modifier and Type | Method and Description |
|---|---|
@Nullable String |
getServerError()
Get the server-error-value from the "e=" server-final-message.
|
byte[] |
getVerifier()
Get the verifier value from the "v=" server-final-message.
|
boolean |
isError()
Whether this server-final-message contains an error.
|
static @NotNull ServerFinalMessage |
parseFrom(@NotNull String serverFinalMessage)
Parses a server-final-message from a String.
|
@NotNull String |
toString()
String representation of the SCRAM message.
|
public ServerFinalMessage(byte[] verifier)
verifier - The bytes of the computed signatureIllegalArgumentException - If the verifier is nullpublic ServerFinalMessage(@NotNull
@NotNull String serverError)
serverError - The error messageIllegalArgumentException - If the error is nullpublic boolean isError()
public byte[] getVerifier()
verifier@Nullable public @Nullable String getServerError()
server-error-value@NotNull public static @NotNull ServerFinalMessage parseFrom(@NotNull @NotNull String serverFinalMessage) throws ScramParseException
serverFinalMessage - The messageScramParseException - If the argument is not a valid server-final-messageIllegalArgumentException - If the message is null or emptyCopyright © 2017–2025 OnGres, Inc. All rights reserved.