Package gnu.java.zrtp.packets
Class ZrtpPacketHello
- java.lang.Object
-
- gnu.java.zrtp.packets.ZrtpPacketBase
-
- gnu.java.zrtp.packets.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>
-
-
Field Summary
-
Fields inherited from class gnu.java.zrtp.packets.ZrtpPacketBase
CLIENT_ID_SIZE, CRC_SIZE, HASH_IMAGE_SIZE, HMAC_SIZE, HVI_SIZE, packetBuffer, ZID_SIZE, ZRTP_HEADER_LENGTH, ZRTP_WORD_SIZE
-
-
Constructor Summary
Constructors Constructor Description ZrtpPacketHello()ZrtpPacketHello(byte[] data)
-
Method Summary
-
Methods inherited from class gnu.java.zrtp.packets.ZrtpPacketBase
getHeaderBase, getLength, getMessageType, isZrtpPacket, setLength, setMessageType, setZrtpId
-
-
-
-
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.
-
findBestCipher
public final ZrtpConstants.SupportedSymCiphers findBestCipher(ZrtpConfigure config, ZrtpConstants.SupportedPubKeys pk)
-
getSelectedHash
public ZrtpConstants.SupportedHashes getSelectedHash()
-
getSelectedCipher
public ZrtpConstants.SupportedSymCiphers getSelectedCipher()
-
findBestPubkey
public final ZrtpConstants.SupportedPubKeys findBestPubkey(ZrtpConfigure config)
-
findBestSASType
public final ZrtpConstants.SupportedSASTypes findBestSASType(ZrtpConfigure config)
-
findBestAuthLen
public final ZrtpConstants.SupportedAuthLengths findBestAuthLen(ZrtpConfigure config)
-
checkMultiStream
public final boolean checkMultiStream()
-
-