Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.neomedia
Class ZrtpControlImpl

java.lang.Object
  extended by net.java.sip.communicator.impl.neomedia.ZrtpControlImpl
All Implemented Interfaces:
SrtpControl, ZrtpControl

public class ZrtpControlImpl
extends Object
implements ZrtpControl

Controls zrtp in the MediaStream.

Author:
Damian Minkov

Nested Class Summary
static class ZrtpControlImpl.ZRTPCustomInfoCodes
          Additional info codes for and data to support ZRTP4J.
 
Constructor Summary
ZrtpControlImpl()
          Creates the control.
 
Method Summary
 void cleanup()
          Cleans up the current zrtp control and its engine.
 String getHelloHash()
          Return the zrtp hello hash String.
 String[] getHelloHashSep()
          Get the ZRTP Hello Hash data - separate strings.
 boolean getSecureCommunicationStatus()
          Method for getting the default secure status value for communication
 String getSecurityString()
          Gets the SAS for the current media stream.
 SrtpListener getSrtpListener()
          Returns the ZrtpListener which listens for security events.
 ZRTPTransformEngine getTransformEngine()
          Returns the zrtp engine currently used by this stream.
 boolean isSecurityVerified()
          Gets the status of the SAS verification.
 boolean requiresSecureSignalingTransport()
          Returns false, ZRTP exchanges is keys over the media path.
 void setConnector(AbstractRTPConnector connector)
          Sets the RTPConnector which is to use or uses this ZRTP engine.
 void setMultistream(SrtpControl master)
          Start multi-stream ZRTP sessions.
 void setSASVerification(boolean verified)
          Sets the SAS verification
 void setSrtpListener(SrtpListener zrtpListener)
          Sets a ZrtpListener that will listen for zrtp security events.
 void start(boolean masterSession)
          Starts and enables zrtp in the stream holding this control.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZrtpControlImpl

ZrtpControlImpl()
Creates the control.

Method Detail

cleanup

public void cleanup()
Cleans up the current zrtp control and its engine.

Specified by:
cleanup in interface SrtpControl

setSrtpListener

public void setSrtpListener(SrtpListener zrtpListener)
Sets a ZrtpListener that will listen for zrtp security events.

Specified by:
setSrtpListener in interface SrtpControl
Parameters:
zrtpListener - the ZrtpListener to set

getSrtpListener

public SrtpListener getSrtpListener()
Returns the ZrtpListener which listens for security events.

Specified by:
getSrtpListener in interface SrtpControl
Returns:
the ZrtpListener which listens for security events

getSecureCommunicationStatus

public boolean getSecureCommunicationStatus()
Method for getting the default secure status value for communication

Specified by:
getSecureCommunicationStatus in interface SrtpControl
Returns:
the default enabled/disabled status value for secure communication

setSASVerification

public void setSASVerification(boolean verified)
Sets the SAS verification

Specified by:
setSASVerification in interface ZrtpControl
Parameters:
verified - the new SAS verification status

getTransformEngine

public ZRTPTransformEngine getTransformEngine()
Returns the zrtp engine currently used by this stream.

Specified by:
getTransformEngine in interface SrtpControl
Returns:
the zrtp engine

start

public void start(boolean masterSession)
Starts and enables zrtp in the stream holding this control.

Specified by:
start in interface SrtpControl
Parameters:
masterSession - whether this stream is master for the current media session.

setMultistream

public void setMultistream(SrtpControl master)
Start multi-stream ZRTP sessions. After the ZRTP Master (DH) session reached secure state the SCCallback calls this method to start the multi-stream ZRTP sessions. enable auto-start mode (auto-sensing) to the engine.

Specified by:
setMultistream in interface SrtpControl
Parameters:
master - master SRTP data

getHelloHash

public String getHelloHash()
Return the zrtp hello hash String.

Specified by:
getHelloHash in interface ZrtpControl
Returns:
String the zrtp hello hash.

getHelloHashSep

public String[] getHelloHashSep()
Get the ZRTP Hello Hash data - separate strings.

Specified by:
getHelloHashSep in interface ZrtpControl
Returns:
String array containing the version string at offset 0, the Hello hash value as hex-digits at offset 1. Hello hash is available immediately after class instantiation. Returns null if ZRTP is not available.

setConnector

public void setConnector(AbstractRTPConnector connector)
Sets the RTPConnector which is to use or uses this ZRTP engine.

Specified by:
setConnector in interface SrtpControl
Parameters:
connector - the RTPConnector which is to use or uses this ZRTP engine

getSecurityString

public String getSecurityString()
Description copied from interface: ZrtpControl
Gets the SAS for the current media stream.

Specified by:
getSecurityString in interface ZrtpControl
Returns:
the four character ZRTP SAS.

isSecurityVerified

public boolean isSecurityVerified()
Description copied from interface: ZrtpControl
Gets the status of the SAS verification.

Specified by:
isSecurityVerified in interface ZrtpControl
Returns:
true when the SAS has been verified.

requiresSecureSignalingTransport

public boolean requiresSecureSignalingTransport()
Returns false, ZRTP exchanges is keys over the media path.

Specified by:
requiresSecureSignalingTransport in interface SrtpControl
Returns:
false

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.