Class 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
    • 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.
    • 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:
        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.
      • 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:
        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.
      • 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.