Package com.ongres.scram.common
Class ClientFinalMessage
- java.lang.Object
-
- com.ongres.scram.common.StringWritable
-
- com.ongres.scram.common.AbstractScramMessage
-
- com.ongres.scram.common.ClientFinalMessage
-
public final class ClientFinalMessage extends AbstractScramMessage
Constructs and parses client-final-messages.Formal Syntax: cbind-input gs2-header [ cbind-data ]
;; cbind-data MUST be present for
;; gs2-cbind-flag of "p" and MUST be absent
;; for "y" or "n".channel-binding "c=" base64
;; base64 encoding of cbind-input.client-final-message-without-proof channel-binding "," nonce ["," extensions] client-final-message client-final-message-without-proof "," proof - See Also:
- [RFC5802] Section 7
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringcbindInputchannel-binding = "c=" base64 encoding of cbind-input.private java.lang.Stringnoncenonce = "r=" c-nonce [s-nonce].private byte[]proofproof = "p=" base64.
-
Constructor Summary
Constructors Constructor Description ClientFinalMessage(Gs2Header gs2Header, byte[] cbindData, java.lang.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 private static voidcheckChannelBinding(Gs2Header gs2Header, byte[] cbindData)private static @NotNull java.lang.StringgenerateCBindInput(@NotNull Gs2Header gs2Header, byte @Nullable [] cbindData)java.lang.StringgetCbindInput()Return the channel-binding "c=" base64 encoding of cbind-input.java.lang.StringgetNonce()Return the nonce.byte[]getProof()Return the proof.(package private) static java.lang.StringBuilderwithoutProof(java.lang.StringBuilder sb, Gs2Header gs2Header, byte[] cbindData, java.lang.String nonce)(package private) java.lang.StringBuilderwriteTo(java.lang.StringBuilder sb)Write the class information to the given StringBuffer.private java.lang.StringBuilderwriteToWithoutProof(@NotNull java.lang.StringBuilder sb)-
Methods inherited from class com.ongres.scram.common.AbstractScramMessage
toString
-
-
-
-
Constructor Detail
-
ClientFinalMessage
public ClientFinalMessage(Gs2Header gs2Header, byte[] cbindData, java.lang.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
-
getCbindInput
public java.lang.String getCbindInput()
Return the channel-binding "c=" base64 encoding of cbind-input.- Returns:
- the
channel-binding
-
getNonce
public java.lang.String getNonce()
Return the nonce.- Returns:
- the
nonce
-
getProof
public byte[] getProof()
Return the proof.- Returns:
- the
proof
-
checkChannelBinding
private static void checkChannelBinding(Gs2Header gs2Header, byte[] cbindData)
-
generateCBindInput
@NotNull private static @NotNull java.lang.String generateCBindInput(@NotNull @NotNull Gs2Header gs2Header, byte @Nullable [] cbindData)
-
writeToWithoutProof
private java.lang.StringBuilder writeToWithoutProof(@NotNull @NotNull java.lang.StringBuilder sb)
-
withoutProof
static java.lang.StringBuilder withoutProof(java.lang.StringBuilder sb, Gs2Header gs2Header, byte[] cbindData, java.lang.String nonce)
-
writeTo
java.lang.StringBuilder writeTo(java.lang.StringBuilder sb)
Description copied from class:StringWritableWrite the class information to the given StringBuffer.- Specified by:
writeToin classStringWritable- Parameters:
sb- Where to write the data.- Returns:
- The same StringBuffer.
-
-