public class SRTCPCryptoContext extends BaseSRTPCryptoContext
authKey, cipherCtr, cipherF8, encKey, ivStore, mac, masterKey, masterSalt, policy, rbStore, REPLAY_WINDOW_SIZE, replayWindow, saltKey, ssrc, tagStore, tempStore
Constructor and Description |
---|
SRTCPCryptoContext(int ssrc)
Construct an empty SRTPCryptoContext using ssrc.
|
SRTCPCryptoContext(int ssrc,
byte[] masterK,
byte[] masterS,
SRTPPolicy policy)
Construct a normal SRTPCryptoContext based on the given parameters.
|
Modifier and Type | Method and Description |
---|---|
(package private) boolean |
checkReplay(int index)
Checks if a packet is a replayed on based on its sequence number.
|
SRTCPCryptoContext |
deriveContext(int ssrc)
Derives a new SRTPCryptoContext for use with a new SSRC.
|
void |
deriveSrtcpKeys()
Derives the srtcp session keys from the master key.
|
void |
processPacketAESCM(RawPacket pkt,
int index)
Performs Counter Mode AES encryption/decryption
|
void |
processPacketAESF8(RawPacket pkt,
int index)
Performs F8 Mode AES encryption/decryption
|
boolean |
reverseTransformPacket(RawPacket pkt)
Transform a SRTCP packet into a RTCP packet.
|
void |
transformPacket(RawPacket pkt)
Transform a RTP packet into a SRTP packet.
|
authenticatePacketHMAC, close, getAuthTagLength, getMKILength, getSSRC
public SRTCPCryptoContext(int ssrc)
ssrc
- SSRC of this SRTPCryptoContextpublic SRTCPCryptoContext(int ssrc, byte[] masterK, byte[] masterS, SRTPPolicy policy)
ssrc
- the RTP SSRC that this SRTP cryptographic context protects.masterKey
- byte array holding the master key for this SRTP
cryptographic context. Refer to chapter 3.2.1 of the RFC about the role
of the master key.masterSalt
- byte array holding the master salt for this SRTP
cryptographic context. It is used to computer the initialization vector
that in turn is input to compute the session key, session authentication
key and the session salt.policy
- SRTP policy for this SRTP cryptographic context, defined
the encryption algorithm, the authentication algorithm, etcboolean checkReplay(int index)
index
- index number of the SRTCP packetpublic SRTCPCryptoContext deriveContext(int ssrc)
ssrc
- The SSRC for this contextpublic void deriveSrtcpKeys()
public void processPacketAESCM(RawPacket pkt, int index)
pkt
- the RTP packet to be encrypted/decryptedpublic void processPacketAESF8(RawPacket pkt, int index)
pkt
- the RTP packet to be encrypted/decryptedpublic boolean reverseTransformPacket(RawPacket pkt)
pkt
- the received RTCP packetpublic void transformPacket(RawPacket pkt)
pkt
- the RTP packet that is going to be sent out
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.