Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.neomedia.transform.zrtp
Class SecurityEventManager

java.lang.Object
  extended by gnu.java.zrtp.ZrtpUserCallback
      extended by net.java.sip.communicator.impl.neomedia.transform.zrtp.SecurityEventManager

public class SecurityEventManager
extends gnu.java.zrtp.ZrtpUserCallback

The user callback class for ZRTP4J. This class constructs and sends events to the ZRTP GUI implementation. The showMessage() function implements a specific check to start associated ZRTP multi-stream sessions. Coordinate this callback class with the associated GUI implementation class

Author:
Emanuel Onica, Werner Dittmann, Yana Stamcheva
See Also:
ZrtpSecurityPanel

Field Summary
static int AUDIO_SESSION
          Indicates an audio session type.
static int VIDEO_SESSION
          Indicates a video session type.
static String WARNING_NO_EXPECTED_RS_MATCH
          A warning String that we display to the user.
static String WARNING_NO_RS_MATCH
          A warning String that we display to the user.
 
Constructor Summary
SecurityEventManager(ZrtpControlImpl zrtpControl)
          The class constructor.
 
Method Summary
 void confirmGoClear()
          Inform the user that ZRTP received "go clear" message from its peer.
 String getSecurityString()
          Gets the SAS for the current media stream.
 boolean isSecurityVerified()
          Gets the status of the SAS verification.
 void secureOff()
          Inform user interface that security is not active any more.
 void secureOn(String cipher)
          Reports the security algorithm that the ZRTP protocol negotiated.
 void securityNegotiationStarted()
          Indicates that we started the process of securing the the connection.
 void setDHSession(boolean isDHSession)
          Set the DH session flag.
 void setSessionType(int type)
          Set the type of this session.
 void setSrtpListener(SrtpListener securityListener)
          Sets a new receiver of the security callback events.
 void showMessage(gnu.java.zrtp.ZrtpCodes.MessageSeverity sev, EnumSet<?> subCode)
          Show some information to user.
 void showSAS(String sas, boolean isVerified)
          ZRTP computes the SAS string after nearly all the negotiation and computations are done internally.
 void zrtpNegotiationFailed(gnu.java.zrtp.ZrtpCodes.MessageSeverity severity, EnumSet<?> subCode)
          Negotiation has failed.
 void zrtpNotSuppOther()
          The other part does not support zrtp.
 
Methods inherited from class gnu.java.zrtp.ZrtpUserCallback
checkSASSignature, signSAS, zrtpAskEnrollment, zrtpInformEnrollment
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WARNING_NO_RS_MATCH

public static final String WARNING_NO_RS_MATCH
A warning String that we display to the user.


WARNING_NO_EXPECTED_RS_MATCH

public static final String WARNING_NO_EXPECTED_RS_MATCH
A warning String that we display to the user.


AUDIO_SESSION

public static final int AUDIO_SESSION
Indicates an audio session type.

See Also:
Constant Field Values

VIDEO_SESSION

public static final int VIDEO_SESSION
Indicates a video session type.

See Also:
Constant Field Values
Constructor Detail

SecurityEventManager

public SecurityEventManager(ZrtpControlImpl zrtpControl)
The class constructor.

Parameters:
zrtpControl - that this manager is to be associated with.
Method Detail

setSessionType

public void setSessionType(int type)
Set the type of this session.

Parameters:
type - the session type. The session type could be either AUDIO_SESSION or VIDEO_SESSION.

setDHSession

public void setDHSession(boolean isDHSession)
Set the DH session flag.

Parameters:
isDHSession - the DH session flag.

secureOn

public void secureOn(String cipher)
Reports the security algorithm that the ZRTP protocol negotiated.

Overrides:
secureOn in class gnu.java.zrtp.ZrtpUserCallback
Parameters:
cipher - the cipher

showSAS

public void showSAS(String sas,
                    boolean isVerified)
ZRTP computes the SAS string after nearly all the negotiation and computations are done internally.

Overrides:
showSAS in class gnu.java.zrtp.ZrtpUserCallback
Parameters:
sas - The string containing the SAS.
isVerified - is sas verified.

showMessage

public void showMessage(gnu.java.zrtp.ZrtpCodes.MessageSeverity sev,
                        EnumSet<?> subCode)
Show some information to user. ZRTP calls this method to display some information to the user. Along with the message ZRTP provides a severity indicator that defines: Info, Warning, Error, and Alert.

Overrides:
showMessage in class gnu.java.zrtp.ZrtpUserCallback
Parameters:
sev - severity of the message.
subCode - the message code.

zrtpNegotiationFailed

public void zrtpNegotiationFailed(gnu.java.zrtp.ZrtpCodes.MessageSeverity severity,
                                  EnumSet<?> subCode)
Negotiation has failed.

Overrides:
zrtpNegotiationFailed in class gnu.java.zrtp.ZrtpUserCallback
Parameters:
severity - of the message.
subCode - the message code.

secureOff

public void secureOff()
Inform user interface that security is not active any more.

Overrides:
secureOff in class gnu.java.zrtp.ZrtpUserCallback

zrtpNotSuppOther

public void zrtpNotSuppOther()
The other part does not support zrtp.

Overrides:
zrtpNotSuppOther in class gnu.java.zrtp.ZrtpUserCallback

confirmGoClear

public void confirmGoClear()
Inform the user that ZRTP received "go clear" message from its peer.

Overrides:
confirmGoClear in class gnu.java.zrtp.ZrtpUserCallback

setSrtpListener

public void setSrtpListener(SrtpListener securityListener)
Sets a new receiver of the security callback events.

Parameters:
securityListener - An object that receives the security events.

getSecurityString

public String getSecurityString()
Gets the SAS for the current media stream.

Returns:
the four character ZRTP SAS.

isSecurityVerified

public boolean isSecurityVerified()
Gets the status of the SAS verification.

Returns:
true when the SAS has been verified.

securityNegotiationStarted

public void securityNegotiationStarted()
Indicates that we started the process of securing the the connection.


Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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