Class ZrtpControlImpl
- java.lang.Object
-
- org.jitsi.service.neomedia.AbstractSrtpControl<ZRTPTransformEngine>
-
- org.jitsi.impl.neomedia.transform.zrtp.ZrtpControlImpl
-
- All Implemented Interfaces:
SrtpControl,ZrtpControl
public class ZrtpControlImpl extends AbstractSrtpControl<ZRTPTransformEngine> implements ZrtpControl
Controls zrtp in the MediaStream.- Author:
- Damian Minkov
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classZrtpControlImpl.ZRTPCustomInfoCodesAdditional info codes for and data to support ZRTP4J.-
Nested classes/interfaces inherited from interface org.jitsi.service.neomedia.SrtpControl
SrtpControl.TransformEngine
-
-
Field Summary
-
Fields inherited from class org.jitsi.service.neomedia.AbstractSrtpControl
transformEngine
-
Fields inherited from interface org.jitsi.service.neomedia.SrtpControl
RTP_SAVP, RTP_SAVPF
-
-
Constructor Summary
Constructors Constructor Description ZrtpControlImpl()Creates the control.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ZRTPTransformEnginecreateTransformEngine()Initializes a new ZRTPTransformEngine instance to be associated with and used by this ZrtpControlImpl instance.voiddoCleanup()Prepares thisSrtpControlfor garbage collection.StringgetCipherString()Gets the cipher information for the current media stream.intgetCurrentProtocolVersion()Get negotiated ZRTP protocol version.StringgetHelloHash(int index)Return the zrtp hello hash String.String[]getHelloHashSep(int index)Get the ZRTP Hello Hash data - separate strings.intgetNumberSupportedVersions()Get number of supported ZRTP protocol versions.StringgetPeerHelloHash()Get the peer's Hello Hash data.byte[]getPeerZid()Gets other party's ZID (ZRTP Identifier) data that was received during ZRTP processing.StringgetPeerZidString()Gets other party's ZID (ZRTP Identifier) data that was received during ZRTP processing as a String.booleangetSecureCommunicationStatus()Method for getting the default secure status value for communicationStringgetSecurityString()Gets the SAS for the current media stream.longgetTimeoutValue()Returns the timeout value that will we will wait and fire timeout secure event if call is not secured.booleanisSecurityVerified()Gets the status of the SAS verification.booleanrequiresSecureSignalingTransport()Returnsfalse, ZRTP exchanges its keys over the media path.voidsetConnector(AbstractRTPConnector connector)Sets the RTPConnector which is to use or uses this ZRTP engine.voidsetMasterSession(boolean masterSession)When in multistream mode, enables the master session.voidsetMultistream(SrtpControl master)Start multi-stream ZRTP sessions.voidsetSASVerification(boolean verified)Sets the SAS verificationvoidstart(org.jitsi.utils.MediaType mediaType)Starts and enables zrtp in the stream holding this control.-
Methods inherited from class org.jitsi.service.neomedia.AbstractSrtpControl
cleanup, getSrtpControlType, getSrtpListener, getTransformEngine, registerUser, setSrtpListener
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jitsi.service.neomedia.SrtpControl
cleanup, getSrtpControlType, getSrtpListener, getTransformEngine, registerUser, setSrtpListener
-
-
-
-
Method Detail
-
doCleanup
public void doCleanup()
Prepares thisSrtpControlfor garbage collection.- Overrides:
doCleanupin classAbstractSrtpControl<ZRTPTransformEngine>
-
getCipherString
public String getCipherString()
Description copied from interface:ZrtpControlGets the cipher information for the current media stream.- Specified by:
getCipherStringin interfaceZrtpControl- Returns:
- the cipher information string.
-
getCurrentProtocolVersion
public int getCurrentProtocolVersion()
Get negotiated ZRTP protocol version.- Specified by:
getCurrentProtocolVersionin interfaceZrtpControl- Returns:
- the integer representation of the negotiated ZRTP protocol version.
-
getHelloHash
public String getHelloHash(int index)
Return the zrtp hello hash String.- Specified by:
getHelloHashin interfaceZrtpControl- Parameters:
index- Hello hash of the Hello packet identfied by index. Index must be 0 <= index < SUPPORTED_ZRTP_VERSIONS.- Returns:
- String the zrtp hello hash.
-
getHelloHashSep
public String[] getHelloHashSep(int index)
Get the ZRTP Hello Hash data - separate strings.- Specified by:
getHelloHashSepin interfaceZrtpControl- Parameters:
index- Hello hash of the Hello packet identfied by index. Index must be 0 <= index < SUPPORTED_ZRTP_VERSIONS.- 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
nullif ZRTP is not available.
-
getNumberSupportedVersions
public int getNumberSupportedVersions()
Get number of supported ZRTP protocol versions.- Specified by:
getNumberSupportedVersionsin interfaceZrtpControl- Returns:
- the number of supported ZRTP protocol versions.
-
getPeerHelloHash
public String getPeerHelloHash()
Get the peer's Hello Hash data. Use this method to get the peer's Hello Hash data. The method returns the data as a string.- Specified by:
getPeerHelloHashin interfaceZrtpControl- Returns:
- a String containing the Hello hash value as hex-digits. Peer Hello hash is available after we received a Hello packet from our peer. If peer's hello hash is not available return null.
-
getPeerZid
public byte[] getPeerZid()
Description copied from interface:ZrtpControlGets other party's ZID (ZRTP Identifier) data that was received during ZRTP processing. The ZID data can be retrieved after ZRTP receives the first Hello packet from the other party.- Specified by:
getPeerZidin interfaceZrtpControl- Returns:
- the ZID data as a byte array.
-
getPeerZidString
public String getPeerZidString()
Description copied from interface:ZrtpControlGets other party's ZID (ZRTP Identifier) data that was received during ZRTP processing as a String. The ZID data can be retrieved after ZRTP receives the first Hello packet from the other party.- Specified by:
getPeerZidStringin interfaceZrtpControl- Returns:
- the ZID data as a String.
-
getSecureCommunicationStatus
public boolean getSecureCommunicationStatus()
Method for getting the default secure status value for communication- Specified by:
getSecureCommunicationStatusin interfaceSrtpControl- Returns:
- the default enabled/disabled status value for secure communication
-
getSecurityString
public String getSecurityString()
Description copied from interface:ZrtpControlGets the SAS for the current media stream.- Specified by:
getSecurityStringin interfaceZrtpControl- Returns:
- the four character ZRTP SAS.
-
getTimeoutValue
public long getTimeoutValue()
Returns the timeout value that will we will wait and fire timeout secure event if call is not secured. The value is in milliseconds.- Specified by:
getTimeoutValuein interfaceZrtpControl- Returns:
- the timeout value that will we will wait and fire timeout secure event if call is not secured.
-
createTransformEngine
protected ZRTPTransformEngine createTransformEngine()
Initializes a new ZRTPTransformEngine instance to be associated with and used by this ZrtpControlImpl instance.- Specified by:
createTransformEnginein classAbstractSrtpControl<ZRTPTransformEngine>- Returns:
- a new ZRTPTransformEngine instance to be associated with and used by this ZrtpControlImpl instance
-
isSecurityVerified
public boolean isSecurityVerified()
Description copied from interface:ZrtpControlGets the status of the SAS verification.- Specified by:
isSecurityVerifiedin interfaceZrtpControl- Returns:
- true when the SAS has been verified.
-
requiresSecureSignalingTransport
public boolean requiresSecureSignalingTransport()
Returnsfalse, ZRTP exchanges its keys over the media path.- Specified by:
requiresSecureSignalingTransportin interfaceSrtpControl- Returns:
false
-
setConnector
public void setConnector(AbstractRTPConnector connector)
Sets the RTPConnector which is to use or uses this ZRTP engine.- Specified by:
setConnectorin interfaceSrtpControl- Parameters:
connector- the RTPConnector which is to use or uses this ZRTP engine
-
setMasterSession
public void setMasterSession(boolean masterSession)
When in multistream mode, enables the master session.- Specified by:
setMasterSessionin interfaceSrtpControl- Overrides:
setMasterSessionin classAbstractSrtpControl<ZRTPTransformEngine>- Parameters:
masterSession- whether current control, controls the master 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:
setMultistreamin interfaceSrtpControl- Overrides:
setMultistreamin classAbstractSrtpControl<ZRTPTransformEngine>- Parameters:
master- master SRTP data
-
setSASVerification
public void setSASVerification(boolean verified)
Sets the SAS verification- Specified by:
setSASVerificationin interfaceZrtpControl- Parameters:
verified- the new SAS verification status
-
start
public void start(org.jitsi.utils.MediaType mediaType)
Starts and enables zrtp in the stream holding this control.- Specified by:
startin interfaceSrtpControl- Parameters:
mediaType- the media type of the stream this control controls.
-
-