Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.neomedia.transform.srtp
Class SRTPTransformer

java.lang.Object
  extended by net.java.sip.communicator.impl.neomedia.transform.srtp.SRTPTransformer
All Implemented Interfaces:
PacketTransformer

public class SRTPTransformer
extends Object
implements PacketTransformer

SRTPTransformer implements PacketTransformer and provides implementations for RTP packet to SRTP packet transformation and SRTP packet to RTP packet transformation logic. It will first find the corresponding SRTPCryptoContext for each packet based on their SSRC and then invoke the context object to perform the transformation and reverse transformation operation.

Author:
Bing SU (nova.su@gmail.com)

Constructor Summary
SRTPTransformer(SRTPTransformEngine engine)
          Initializes a new SRTPTransformer instance.
SRTPTransformer(SRTPTransformEngine forwardEngine, SRTPTransformEngine reverseEngine)
          Constructs a SRTPTransformer object.
 
Method Summary
 void close()
          Closes this SRTPTransformer and the underlying transform engines.It closes all stored crypto contexts.
 RawPacket reverseTransform(RawPacket pkt)
          Reverse-transforms a specific packet (i.e.
 RawPacket transform(RawPacket pkt)
          Transforms a specific packet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SRTPTransformer

public SRTPTransformer(SRTPTransformEngine engine)
Initializes a new SRTPTransformer instance.

Parameters:
engine - the SRTPTransformEngine to be used by the new instance for both directions

SRTPTransformer

public SRTPTransformer(SRTPTransformEngine forwardEngine,
                       SRTPTransformEngine reverseEngine)
Constructs a SRTPTransformer object.

Parameters:
forwardEngine - The associated SRTPTransformEngine object for forward transformations.
reverseEngine - The associated SRTPTransformEngine object for reverse transformations.
Method Detail

close

public void close()
Closes this SRTPTransformer and the underlying transform engines.It closes all stored crypto contexts. It deletes key data and forces a cleanup of the crypto contexts.

Specified by:
close in interface PacketTransformer

reverseTransform

public RawPacket reverseTransform(RawPacket pkt)
Reverse-transforms a specific packet (i.e. transforms a transformed packet back).

Specified by:
reverseTransform in interface PacketTransformer
Parameters:
pkt - the transformed packet to be restored
Returns:
the restored packet

transform

public RawPacket transform(RawPacket pkt)
Transforms a specific packet.

Specified by:
transform in interface PacketTransformer
Parameters:
pkt - the packet to be transformed
Returns:
the transformed packet

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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