Class ClientFinalMessage

  • All Implemented Interfaces:
    StringWritable

    public class ClientFinalMessage
    extends java.lang.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 "," proof Note that extensions are not supported.
    See Also:
    [RFC5802] Section 7
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String cbind  
      private java.lang.String nonce  
      private byte[] proof  
    • 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 java.lang.String generateCBind​(Gs2Header gs2Header, byte[] cbindData)  
      java.lang.String toString()  
      java.lang.StringBuffer writeTo​(java.lang.StringBuffer sb)
      Write the class information to the given StringBuffer.
      static java.lang.StringBuffer writeToWithoutProof​(Gs2Header gs2Header, byte[] cbindData, java.lang.String nonce)
      Returns a StringBuffer filled in with the formatted output of a client-first-message without the proof value.
      private static java.lang.StringBuffer writeToWithoutProof​(java.lang.StringBuffer sb, Gs2Header gs2Header, byte[] cbindData, java.lang.String nonce)  
      private static java.lang.StringBuffer writeToWithoutProof​(java.lang.StringBuffer sb, java.lang.String cbind, java.lang.String nonce)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • cbind

        private final java.lang.String cbind
      • nonce

        private final java.lang.String nonce
      • proof

        private final byte[] proof
    • 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 header
        cbindData - If using channel binding, the channel binding data
        nonce - The nonce
        proof - The bytes representing the computed client proof
    • Method Detail

      • generateCBind

        private static java.lang.String generateCBind​(Gs2Header gs2Header,
                                                      byte[] cbindData)
      • writeToWithoutProof

        private static java.lang.StringBuffer writeToWithoutProof​(java.lang.StringBuffer sb,
                                                                  java.lang.String cbind,
                                                                  java.lang.String nonce)
      • writeToWithoutProof

        private static java.lang.StringBuffer writeToWithoutProof​(java.lang.StringBuffer sb,
                                                                  Gs2Header gs2Header,
                                                                  byte[] cbindData,
                                                                  java.lang.String nonce)
      • writeToWithoutProof

        public static java.lang.StringBuffer writeToWithoutProof​(Gs2Header gs2Header,
                                                                 byte[] cbindData,
                                                                 java.lang.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 header
        cbindData - The optional channel binding data
        nonce - The nonce
        Returns:
        The String representation of the part of the message that excludes the proof
      • writeTo

        public java.lang.StringBuffer writeTo​(java.lang.StringBuffer sb)
        Description copied from interface: StringWritable
        Write the class information to the given StringBuffer.
        Specified by:
        writeTo in interface StringWritable
        Parameters:
        sb - Where to write the data.
        Returns:
        The same StringBuffer.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object