Class ClientFinalMessage
- java.lang.Object
-
- com.impossibl.postgres.protocol.sasl.scram.message.ClientFinalMessage
-
- All Implemented Interfaces:
StringWritable
public class ClientFinalMessage extends Object implements StringWritable
Constructs and parses client-final-messages. Formal syntax is:client-final-message-without-proof = channel-binding "," nonce ["," extensions] client-final-message = client-final-message-without-proof "," proofNote that extensions are not supported.- See Also:
- [RFC5802] Section 7
-
-
Constructor Summary
Constructors Constructor Description ClientFinalMessage(Gs2Header gs2Header, byte[] cbindData, String nonce, byte[] proof)Constructus a client-final-message with the provided gs2Header (the same one used in the client-first-message), optionally the channel binding data, and the nonce.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringtoString()StringBufferwriteTo(StringBuffer sb)Write the class information to the given StringBuffer.static StringBufferwriteToWithoutProof(Gs2Header gs2Header, byte[] cbindData, String nonce)Returns a StringBuffer filled in with the formatted output of a client-first-message without the proof value.
-
-
-
Constructor Detail
-
ClientFinalMessage
public ClientFinalMessage(Gs2Header gs2Header, byte[] cbindData, String nonce, byte[] proof)
Constructus a client-final-message with the provided gs2Header (the same one used in the client-first-message), optionally the channel binding data, and the nonce. This method is intended to be used by SCRAM clients, and not to be constructed directly.- Parameters:
gs2Header- The GSS-API headercbindData- If using channel binding, the channel binding datanonce- The nonceproof- The bytes representing the computed client proof
-
-
Method Detail
-
writeToWithoutProof
public static StringBuffer writeToWithoutProof(Gs2Header gs2Header, byte[] cbindData, String nonce)
Returns a StringBuffer filled in with the formatted output of a client-first-message without the proof value. This is useful for computing the auth-message, used in turn to compute the proof.- Parameters:
gs2Header- The GSS-API headercbindData- The optional channel binding datanonce- The nonce- Returns:
- The String representation of the part of the message that excludes the proof
-
writeTo
public StringBuffer writeTo(StringBuffer sb)
Description copied from interface:StringWritableWrite the class information to the given StringBuffer.- Specified by:
writeToin interfaceStringWritable- Parameters:
sb- Where to write the data.- Returns:
- The same StringBuffer.
-
-