StringWritable
public class ServerFinalMessage extends Object implements StringWritable
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" /
server-error-value-ext
; Unrecognized errors should be treated as "other-error".
; In order to prevent information disclosure, the server
; may substitute the real reason with "other-error".
server-error-value-ext = value
; Additional error reasons added by extensions
; to this document.
verifier = "v=" base64
;; base-64 encoded ServerSignature.
server-final-errorMessage = (server-error / verifier)
["," extensions]
Note that extensions are not supported (and, consequently, error message extensions).Modifier and Type | Class | Description |
---|---|---|
static class |
ServerFinalMessage.Error |
Possible error messages sent on a server-final-message.
|
Constructor | Description |
---|---|
ServerFinalMessage(byte[] verifier) |
Constructs a server-final-message with no errors, and the provided server verifier
|
ServerFinalMessage(ServerFinalMessage.Error error) |
Constructs a server-final-message which represents a SCRAM error.
|
Modifier and Type | Method | Description |
---|---|---|
Optional<ServerFinalMessage.Error> |
getError() |
|
Optional<byte[]> |
getVerifier() |
|
boolean |
isError() |
Whether this server-final-message contains an error
|
static ServerFinalMessage |
parseFrom(String serverFinalMessage) |
Parses a server-final-message from a String.
|
String |
toString() |
|
StringBuffer |
writeTo(StringBuffer sb) |
Write the class information to the given StringBuffer.
|
public ServerFinalMessage(byte[] verifier) throws IllegalArgumentException
verifier
- The bytes of the computed signatureIllegalArgumentException
- If the verifier is nullpublic ServerFinalMessage(ServerFinalMessage.Error error) throws IllegalArgumentException
error
- The errorIllegalArgumentException
- If the error is nullpublic boolean isError()
public Optional<byte[]> getVerifier()
public Optional<ServerFinalMessage.Error> getError()
public StringBuffer writeTo(StringBuffer sb)
StringWritable
writeTo
in interface StringWritable
sb
- Where to write the data.public static ServerFinalMessage parseFrom(String serverFinalMessage) throws ScramParseException, IllegalArgumentException
serverFinalMessage
- The messageScramParseException
- If the argument is not a valid server-final-messageIllegalArgumentException
- If the message is null or emptyCopyright © 2017–2018. All rights reserved.