Class SRTPTransformer
- java.lang.Object
-
- org.jitsi.impl.neomedia.transform.SinglePacketTransformer
-
- org.jitsi.impl.neomedia.transform.srtp.SRTPTransformer
-
- All Implemented Interfaces:
PacketTransformer
public class SRTPTransformer extends SinglePacketTransformer
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
Constructors Constructor Description SRTPTransformer(org.jitsi.srtp.SrtpContextFactory factory)Initializes a new SRTPTransformer instance.SRTPTransformer(org.jitsi.srtp.SrtpContextFactory forwardFactory, org.jitsi.srtp.SrtpContextFactory reverseFactory)Constructs a SRTPTransformer object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes this SRTPTransformer and the underlying transform engines.It closes all stored crypto contexts.RawPacketreverseTransform(RawPacket pkt)Reverse-transforms a specific packet (i.e.voidsetContextFactory(org.jitsi.srtp.SrtpContextFactory factory, boolean forward)Sets a new key factory when key material has changed.RawPackettransform(RawPacket pkt)Transforms a specific packet.-
Methods inherited from class org.jitsi.impl.neomedia.transform.SinglePacketTransformer
reverseTransform, transform
-
-
-
-
Constructor Detail
-
SRTPTransformer
public SRTPTransformer(org.jitsi.srtp.SrtpContextFactory factory)
Initializes a new SRTPTransformer instance.- Parameters:
factory- the context factory to be used by the new instance for both directions.
-
SRTPTransformer
public SRTPTransformer(org.jitsi.srtp.SrtpContextFactory forwardFactory, org.jitsi.srtp.SrtpContextFactory reverseFactory)Constructs a SRTPTransformer object.- Parameters:
forwardFactory- The associated context factory for forward transformations.reverseFactory- The associated context factory for reverse transformations.
-
-
Method Detail
-
setContextFactory
public void setContextFactory(org.jitsi.srtp.SrtpContextFactory factory, boolean forward)Sets a new key factory when key material has changed.- Parameters:
factory- The associated context factory for transformations.forward- true if the supplied factory is for forward transformations, false for the reverse transformation factory.
-
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:
closein interfacePacketTransformer- Overrides:
closein classSinglePacketTransformer
-
reverseTransform
public RawPacket reverseTransform(RawPacket pkt)
Reverse-transforms a specific packet (i.e. transforms a transformed packet back).- Specified by:
reverseTransformin classSinglePacketTransformer- Parameters:
pkt- the transformed packet to be restored- Returns:
- the restored packet
-
transform
public RawPacket transform(RawPacket pkt)
Transforms a specific packet.- Specified by:
transformin classSinglePacketTransformer- Parameters:
pkt- the packet to be transformed- Returns:
- the transformed packet
-
-