Class SecurityEventManager
- java.lang.Object
-
- gnu.java.zrtp.ZrtpUserCallback
-
- org.jitsi.impl.neomedia.transform.zrtp.SecurityEventManager
-
public class SecurityEventManager extends gnu.java.zrtp.ZrtpUserCallbackThe user callback class for ZRTP4J. This class constructs and sends events to the ZRTP GUI implementation. TheshowMessage()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
-
-
Field Summary
Fields Modifier and Type Field Description static StringWARNING_NO_EXPECTED_RS_MATCHA warning String that we display to the user.static StringWARNING_NO_RS_MATCHA warning String that we display to the user.
-
Constructor Summary
Constructors Constructor Description SecurityEventManager(ZrtpControlImpl zrtpControl)The class constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconfirmGoClear()Inform the user that ZRTP received "go clear" message from its peer.StringgetCipherString()Gets the cipher information for the current media stream.StringgetSecurityString()Gets the SAS for the current media stream.booleanisSecurityVerified()Gets the status of the SAS verification.voidsecureOff()Inform user interface that security is not active any more.voidsecureOn(String cipher)Reports the security algorithm that the ZRTP protocol negotiated.voidsecurityNegotiationStarted()Indicates that we started the process of securing the the connection.voidsetSASVerified(boolean isVerified)Sets current SAS verification status.voidsetSessionType(org.jitsi.utils.MediaType sessionType)Set the type of this session.voidsetSrtpListener(SrtpListener securityListener)Sets a new receiver of the security callback events.voidshowMessage(gnu.java.zrtp.ZrtpCodes.MessageSeverity sev, EnumSet<?> subCode)Show some information to user.voidshowSAS(String sas, boolean isVerified)ZRTP computes the SAS string after nearly all the negotiation and computations are done internally.voidzrtpNegotiationFailed(gnu.java.zrtp.ZrtpCodes.MessageSeverity severity, EnumSet<?> subCode)Negotiation has failed.voidzrtpNotSuppOther()The other part does not support zrtp.
-
-
-
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(org.jitsi.utils.MediaType sessionType)
Set the type of this session.- Parameters:
sessionType- the MediaType of this session
-
secureOn
public void secureOn(String cipher)
Reports the security algorithm that the ZRTP protocol negotiated.- Overrides:
secureOnin classgnu.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:
showSASin classgnu.java.zrtp.ZrtpUserCallback- Parameters:
sas- The string containing the SAS.isVerified- is sas verified.
-
setSASVerified
public void setSASVerified(boolean isVerified)
Sets current SAS verification status.- Parameters:
isVerified- flag indicating whether SAS has been 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:
showMessagein classgnu.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:
zrtpNegotiationFailedin classgnu.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:
secureOffin classgnu.java.zrtp.ZrtpUserCallback
-
zrtpNotSuppOther
public void zrtpNotSuppOther()
The other part does not support zrtp.- Overrides:
zrtpNotSuppOtherin classgnu.java.zrtp.ZrtpUserCallback
-
confirmGoClear
public void confirmGoClear()
Inform the user that ZRTP received "go clear" message from its peer.- Overrides:
confirmGoClearin classgnu.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.
-
getCipherString
public String getCipherString()
Gets the cipher information for the current media stream.- Returns:
- the cipher information string.
-
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.
-
-