Class ZrtpPacketHello


  • public class ZrtpPacketHello
    extends ZrtpPacketBase
    Implement the Hello packet. The ZRTP message Hello. The implementation sends this to start the ZRTP negotiation sequence. The Hello message offers crypto methods and parameters to the other party. The other party selects methods and parameters it can support and uses the Commit message to commit these.
    Author:
    Werner Dittmann <Werner.Dittmann@t-online.de>
    • Constructor Detail

      • ZrtpPacketHello

        public ZrtpPacketHello()
      • ZrtpPacketHello

        public ZrtpPacketHello​(byte[] data)
    • Method Detail

      • configureHello

        public void configureHello​(ZrtpConfigure config)
      • setClientId

        public final void setClientId​(String text)
      • setH3

        public final void setH3​(byte[] data)
      • getH3

        public final byte[] getH3()
      • setZid

        public final void setZid​(byte[] data)
      • getZid

        public final byte[] getZid()
      • setVersion

        public final void setVersion​(byte[] data)
      • getVersion

        public final byte[] getVersion()
      • getVersionInt

        public final int getVersionInt()
      • setHashType

        public final void setHashType​(int n,
                                      byte[] data)
      • setCipherType

        public final void setCipherType​(int n,
                                        byte[] data)
      • setAuthLen

        public final void setAuthLen​(int n,
                                     byte[] data)
      • setPubKeyType

        public final void setPubKeyType​(int n,
                                        byte[] data)
      • setSasType

        public final void setSasType​(int n,
                                     byte[] data)
      • setHMAC

        public final void setHMAC​(byte[] data)
      • setMitmMode

        public final void setMitmMode()
      • isMitmMode

        public final boolean isMitmMode()
      • setSasSign

        public final void setSasSign()
      • isSasSign

        public final boolean isSasSign()
      • isLengthOk

        public final boolean isLengthOk()
      • isSameVersion

        public final boolean isSameVersion​(byte[] data)
        Check if version data matches.
        Parameters:
        data - The data to compare against.
        Returns:
        true if data matches the packet version data, false other wise.
      • findBestHash

        public final ZrtpConstants.SupportedHashes findBestHash​(ZrtpConfigure config)
        Find matching algorithms in Hello packet. The next functions look up and return a prefered algorithm. These functions work as follows: - If the Hello packet does not contain an algorithm (number of algorithms is zero) then return our prefered algorithm. This prefered algorithm must be one of the mandatory algorithms specified in chapter 6.1.x. - If the functions find a match return the found algorithm. - If the functions do not find a match return a prefered, mandatory algorithm. This guarantees that we always return a supported alogrithm. The mandatory algorithms are: (internal enums are our prefered algoritms) Hash: S256 (SHA 256) (internal enum Sha256) Symmetric Cipher: AES1 (AES 128) (internal enum Aes128) SRTP Authentication: HS32 and HS80 (32/80 bits) (internal enum AuthLen32) Key Agreement: DH3k (3072 Diffie-Helman) (internal enum Dh3072) Find macthing Hash type.
        Returns:
        found matching hash or default SHA 256.
      • checkMultiStream

        public final boolean checkMultiStream()