public class ServerFirstMessage extends Object implements StringWritable
server-first-message = [reserved-mext ","] nonce "," salt ","
iteration-count ["," extensions]
Note that extensions are not supported.| Modifier and Type | Field and Description |
|---|---|
static int |
ITERATION_MIN_VALUE
Minimum allowed value for the iteration, as per the RFC.
|
| Constructor and Description |
|---|
ServerFirstMessage(String clientNonce,
String serverNonce,
String salt,
int iteration)
Constructs a server-first-message from a client-first-message and the additional required data.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getClientNonce() |
int |
getIteration() |
String |
getNonce() |
String |
getSalt() |
String |
getServerNonce() |
static ServerFirstMessage |
parseFrom(String serverFirstMessage,
String clientNonce)
Parses a server-first-message from a String.
|
String |
toString() |
StringBuffer |
writeTo(StringBuffer sb)
Write the class information to the given StringBuffer.
|
public static final int ITERATION_MIN_VALUE
public ServerFirstMessage(String clientNonce, String serverNonce, String salt, int iteration) throws IllegalArgumentException
clientNonce - String representing the client-first-messageserverNonce - Server serverNoncesalt - The saltiteration - The iteration count (must be <= 4096)IllegalArgumentException - If clientFirstMessage, serverNonce or salt are null or empty,
or iteration < 4096public String getClientNonce()
public String getServerNonce()
public String getNonce()
public String getSalt()
public int getIteration()
public StringBuffer writeTo(StringBuffer sb)
StringWritablewriteTo in interface StringWritablesb - Where to write the data.public static ServerFirstMessage parseFrom(String serverFirstMessage, String clientNonce) throws ScramParseException, IllegalArgumentException
serverFirstMessage - The string representing the server-first-messageclientNonce - The serverNonce 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–2020. All rights reserved.