|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.java.sip.communicator.impl.neomedia.transform.srtp.SRTCPCryptoContext
public class SRTCPCryptoContext
SRTPCryptoContext class is the core class of SRTP implementation. There can be multiple SRTP sources in one SRTP session. And each SRTP stream has a corresponding SRTPCryptoContext object, identified by SSRC. In this way, different sources can be protected independently. SRTPCryptoContext class acts as a manager class and maintains all the information used in SRTP transformation. It is responsible for deriving encryption keys / salting keys / authentication keys from master keys. And it will invoke certain class to encrypt / decrypt (transform / reverse transform) RTP packets. It will hold a replay check db and do replay check against incoming packets. Refer to section 3.2 in RFC3711 for detailed description of cryptographic context. Cryptographic related parameters, i.e. encryption mode / authentication mode, master encryption key and master salt key are determined outside the scope of SRTP implementation. They can be assigned manually, or can be assigned automatically using some key management protocol, such as MIKEY (RFC3830) or Phil Zimmermann's ZRTP protocol.
| Constructor Summary | |
|---|---|
SRTCPCryptoContext(long ssrcIn)
Construct an empty SRTPCryptoContext using ssrc. |
|
SRTCPCryptoContext(long ssrcIn,
byte[] masterK,
byte[] masterS,
SRTPPolicy policyIn)
Construct a normal SRTPCryptoContext based on the given parameters. |
|
| Method Summary | |
|---|---|
(package private) boolean |
checkReplay(int index)
Checks if a packet is a replayed on based on its sequence number. |
void |
close()
Close the crypto context. |
SRTCPCryptoContext |
deriveContext(long ssrc)
Derive a new SRTPCryptoContext for use with a new SSRC This method returns a new SRTPCryptoContext initialized with the data of this SRTPCryptoContext. |
void |
deriveSrtcpKeys()
Derives the srtcp session keys from the master key. |
int |
getAuthTagLength()
Get the authentication tag length of this SRTP cryptographic context |
int |
getMKILength()
Get the MKI length of this SRTP cryptographic context |
long |
getSSRC()
Get the SSRC of this SRTP cryptographic context |
void |
processPacketAESCM(RawPacket pkt,
int index)
Perform Counter Mode AES encryption / decryption |
void |
processPacketAESF8(RawPacket pkt,
int index)
Perform 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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SRTCPCryptoContext(long ssrcIn)
ssrc - SSRC of this SRTPCryptoContext
public SRTCPCryptoContext(long ssrcIn,
byte[] masterK,
byte[] masterS,
SRTPPolicy policyIn)
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, etc| Method Detail |
|---|
public void close()
public int getAuthTagLength()
public int getMKILength()
public long getSSRC()
public void transformPacket(RawPacket pkt)
pkt - the RTP packet that is going to be sent outpublic boolean reverseTransformPacket(RawPacket pkt)
pkt - the received RTCP packet
public void processPacketAESCM(RawPacket pkt,
int index)
pkt - the RTP packet to be encrypted / decrypted
public void processPacketAESF8(RawPacket pkt,
int index)
pkt - the RTP packet to be encrypted / decryptedboolean checkReplay(int index)
index - index number of the SRTCP packet
public void deriveSrtcpKeys()
public SRTCPCryptoContext deriveContext(long ssrc)
ssrc - The SSRC for this context
|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||