Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.neomedia.transform.sdes
Class SDesControlImpl

java.lang.Object
  extended by net.java.sip.communicator.impl.neomedia.transform.sdes.SDesControlImpl
All Implemented Interfaces:
SDesControl, SrtpControl

public class SDesControlImpl
extends Object
implements SDesControl

Default implementation of SDesControl that supports the crypto suites of the original RFC4568 and the KDR parameter, but nothing else.

Author:
Ingo Bauersachs

Field Summary
 
Fields inherited from interface net.java.sip.communicator.service.neomedia.SDesControl
SDES_CIPHER_SUITES
 
Constructor Summary
SDesControlImpl()
          SDESControl
 
Method Summary
 void cleanup()
          Cleans up the current SRTP control and its engine.
 ch.imvs.sdes4j.srtp.SrtpCryptoAttribute getInAttribute()
          Gets the crypto attribute of the incoming MediaStream.
 String[] getInitiatorCryptoAttributes()
          Gets the encoded SDES crypto-attributes for all enabled ciphers when the control is used as the initiator.
 ch.imvs.sdes4j.srtp.SrtpCryptoAttribute getOutAttribute()
          Gets the crypto attribute of the outgoing MediaStream.
 boolean getSecureCommunicationStatus()
          Gets the default secure/insecure communication status for the supported call sessions.
 SrtpListener getSrtpListener()
          Returns the SrtpListener which listens for security events.
 Iterable<String> getSupportedCryptoSuites()
          Gets all supported cipher suites.
 TransformEngine getTransformEngine()
          Returns the transform engine currently used by this stream.
 boolean initiatorSelectAttribute(Iterable<String> peerAttributes)
          Select the local crypto attribute from the initial offering (@see SDesControl.getInitiatorCryptoAttributes()) based on the peer's first matching cipher suite.
 boolean requiresSecureSignalingTransport()
          Returns true, SDES always requires the secure transport of its keys.
 String responderSelectAttribute(Iterable<String> peerAttributes)
          Chooses a supported crypto attribute from the peer's list of supplied attributes and creates the local crypto attribute.
 void setConnector(AbstractRTPConnector newValue)
          Sets the RTPConnector which is to use or uses this SRTP engine.
 void setEnabledCiphers(Iterable<String> ciphers)
          Set the enabled SDES ciphers.
 void setMasterSession(boolean masterSession)
          Not used.
 void setMultistream(SrtpControl master)
          Sets the multistream data, which means that the master stream has successfully started and this will start all other streams in this session.
 void setSrtpListener(SrtpListener srtpListener)
          Sets a SrtpListener that will listen for security events.
 void start(MediaType type)
          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

SDesControlImpl

public SDesControlImpl()
SDESControl

Method Detail

setEnabledCiphers

public void setEnabledCiphers(Iterable<String> ciphers)
Description copied from interface: SDesControl
Set the enabled SDES ciphers.

Specified by:
setEnabledCiphers in interface SDesControl
Parameters:
ciphers - The list of enabled ciphers.

getSupportedCryptoSuites

public Iterable<String> getSupportedCryptoSuites()
Description copied from interface: SDesControl
Gets all supported cipher suites.

Specified by:
getSupportedCryptoSuites in interface SDesControl
Returns:
all supported cipher suites.

cleanup

public void cleanup()
Description copied from interface: SrtpControl
Cleans up the current SRTP control and its engine.

Specified by:
cleanup in interface SrtpControl

setSrtpListener

public void setSrtpListener(SrtpListener srtpListener)
Description copied from interface: SrtpControl
Sets a SrtpListener that will listen for security events.

Specified by:
setSrtpListener in interface SrtpControl
Parameters:
srtpListener - the SrtpListener that will receive the events

getSrtpListener

public SrtpListener getSrtpListener()
Description copied from interface: SrtpControl
Returns the SrtpListener which listens for security events.

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

getSecureCommunicationStatus

public boolean getSecureCommunicationStatus()
Description copied from interface: SrtpControl
Gets the default secure/insecure communication status for the supported call sessions.

Specified by:
getSecureCommunicationStatus in interface SrtpControl
Returns:
default secure communication status for the supported call sessions.

setMasterSession

public void setMasterSession(boolean masterSession)
Not used.

Specified by:
setMasterSession in interface SrtpControl
Parameters:
masterSession - not used.

start

public void start(MediaType type)
Description copied from interface: SrtpControl
Starts and enables zrtp in the stream holding this control.

Specified by:
start in interface SrtpControl
Parameters:
type - the media type of the stream this control controls.

setMultistream

public void setMultistream(SrtpControl master)
Description copied from interface: SrtpControl
Sets the multistream data, which means that the master stream has successfully started and this will start all other streams in this session.

Specified by:
setMultistream in interface SrtpControl
Parameters:
master - The security control of the master stream.

getTransformEngine

public TransformEngine getTransformEngine()
Description copied from interface: SrtpControl
Returns the transform engine currently used by this stream.

Specified by:
getTransformEngine in interface SrtpControl
Returns:
the RTP stream transformation engine

getInitiatorCryptoAttributes

public String[] getInitiatorCryptoAttributes()
Description copied from interface: SDesControl
Gets the encoded SDES crypto-attributes for all enabled ciphers when the control is used as the initiator.

Specified by:
getInitiatorCryptoAttributes in interface SDesControl
Returns:
the encoded SDES crypto-attributes for all enabled ciphers.

responderSelectAttribute

public String responderSelectAttribute(Iterable<String> peerAttributes)
Description copied from interface: SDesControl
Chooses a supported crypto attribute from the peer's list of supplied attributes and creates the local crypto attribute. Used when the control is running in the role as responder.

Specified by:
responderSelectAttribute in interface SDesControl
Parameters:
peerAttributes - The peer's crypto attribute offering.
Returns:
The local crypto attribute for the answer of the offer or null if no matching cipher suite could be found.

initiatorSelectAttribute

public boolean initiatorSelectAttribute(Iterable<String> peerAttributes)
Description copied from interface: SDesControl
Select the local crypto attribute from the initial offering (@see SDesControl.getInitiatorCryptoAttributes()) based on the peer's first matching cipher suite.

Specified by:
initiatorSelectAttribute in interface SDesControl
Parameters:
peerAttributes - The peer's crypto offers.
Returns:
True when a matching cipher suite was found, false otherwise.

getInAttribute

public ch.imvs.sdes4j.srtp.SrtpCryptoAttribute getInAttribute()
Description copied from interface: SDesControl
Gets the crypto attribute of the incoming MediaStream.

Specified by:
getInAttribute in interface SDesControl
Returns:
the crypto attribute of the incoming MediaStream.

getOutAttribute

public ch.imvs.sdes4j.srtp.SrtpCryptoAttribute getOutAttribute()
Description copied from interface: SDesControl
Gets the crypto attribute of the outgoing MediaStream.

Specified by:
getOutAttribute in interface SDesControl
Returns:
the crypto attribute of the outgoing MediaStream.

setConnector

public void setConnector(AbstractRTPConnector newValue)
Description copied from interface: SrtpControl
Sets the RTPConnector which is to use or uses this SRTP engine.

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

requiresSecureSignalingTransport

public boolean requiresSecureSignalingTransport()
Returns true, SDES always requires the secure transport of its keys.

Specified by:
requiresSecureSignalingTransport in interface SrtpControl
Returns:
true

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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