The implementation for a SRTCP cryptographic context. More...
#include <CryptoContextCtrl.h>
The implementation for a SRTCP cryptographic context.
This class holds data and provides functions that implement a cryptographic context for SRTP, Refer to RFC 3711, chapter 3.2 for some more detailed information about the SRTP cryptographic context.
Each SRTP cryptographic context maintains a RTP source identified by its SSRC. Thus you can independently protect each source inside a RTP session.
Key management mechanisms negotiate the parameters for the SRTP cryptographic context, such as master key, key length, authentication length and so on. The key management mechanisms are not part of SRTP. Refer to MIKEY (RFC 3880) or to Phil Zimmermann's ZRTP protocol (draft-zimmermann-avt-zrtp-01). After key management negotiated the data the application can setup the SRTCP cryptographic context and enable SRTCP processing.
Definition at line 61 of file CryptoContextCtrl.h.
Constructor for empty SRTP cryptographic context.
This constructor creates an empty SRTP cryptographic context were all algorithms are set to the null algorithm, that is no SRTP processing is performed.
Constructor for an active SRTP cryptographic context.
This constructor creates an active SRTP cryptographic context were algorithms are enabled, keys are computed and so on. This SRTP cryptographic context can protect a RTP SSRC stream.
SrtpEncryptionNull, SrtpEncryptionAESCM, SrtpEncryptionAESF8
. See chapter 4.1.1 for AESCM (Counter mode) and 4.1.2 for AES F8 mode. SrtpEncryptionNull, SrtpAuthenticationSha1Hmac
. The only active algorithm here is SHA1 HMAC, a SHA1 based hashed message authentication code as defined in RFC 2104.masterKeyLength
bytes. Refer to chapter 3.2.1 of the RFC about the role of the master key.Destructor.
Cleans the SRTP cryptographic context.
Check for packet replay.
The method check if a received packet is either to old or was already received.
The method supports a 64 packet history relative the the given sequence number.
true
if no replay, false
if packet is too old ar was already received. Perform key derivation according to SRTP specification.
This method computes the session key, session authentication key and the session salt key. This method must be called at least once after the SRTP Cryptograhic context was set up.
guessIndex
method. Get the length of the MKI in bytes.
Definition at line 250 of file CryptoContextCtrl.h.
Get the SSRC of this SRTP Cryptograhic context.
Definition at line 259 of file CryptoContextCtrl.h.
Get the length of the SRTP authentication tag in bytes.
Definition at line 240 of file CryptoContextCtrl.h.
Derive a new Crypto Context for use with a new SSRC.
This method returns a new Crypto Context initialized with the data of this crypto context. Replacing the SSRC, Roll-over-Counter, and the key derivation rate the application cab use this Crypto Context to encrypt / decrypt a new stream (Synchronization source) inside one RTP session.
Before the application can use this crypto context it must call the deriveSrtpKeys
method.
Compute the authentication tag.
Compute the authentication tag according the the paramters in the SRTP Cryptograhic context.
tagLength
bytes. Perform SRTP encryption.
This method encrypts and decrypts SRTP payload data. Plain data gets encrypted, encrypted data get decrypted.
guessIndex
method.Update the SRTP packet index.
Call this method after all checks were successful. See chapter 3.3.1 in the RFC when to update the ROC and ROC processing.
Definition at line 311 of file CryptoContextCtrl.h.
Definition at line 313 of file CryptoContextCtrl.h.
Definition at line 323 of file CryptoContextCtrl.h.
Definition at line 310 of file CryptoContextCtrl.h.
Definition at line 312 of file CryptoContextCtrl.h.
Definition at line 324 of file CryptoContextCtrl.h.
Definition at line 306 of file CryptoContextCtrl.h.
Definition at line 304 of file CryptoContextCtrl.h.
Definition at line 308 of file CryptoContextCtrl.h.
Definition at line 317 of file CryptoContextCtrl.h.
Definition at line 297 of file CryptoContextCtrl.h.
Definition at line 298 of file CryptoContextCtrl.h.
Definition at line 299 of file CryptoContextCtrl.h.
Definition at line 300 of file CryptoContextCtrl.h.
Definition at line 290 of file CryptoContextCtrl.h.
Definition at line 289 of file CryptoContextCtrl.h.
Definition at line 305 of file CryptoContextCtrl.h.
Definition at line 303 of file CryptoContextCtrl.h.
Definition at line 307 of file CryptoContextCtrl.h.
Definition at line 295 of file CryptoContextCtrl.h.
Definition at line 292 of file CryptoContextCtrl.h.
Definition at line 314 of file CryptoContextCtrl.h.
Definition at line 287 of file CryptoContextCtrl.h.
Definition at line 315 of file CryptoContextCtrl.h.
Definition at line 288 of file CryptoContextCtrl.h.