Class SRTPSettings
- Namespace
- VisioForge.Core.Types.X.Special
- Assembly
- VisioForge.Core.dll
Provides configuration settings for SRTP (Secure Real-time Transport Protocol) encryption and decryption operations. SRTP provides confidentiality, message authentication, and replay protection for RTP/RTCP traffic.
public class SRTPSettingsInheritance
Inherited Members
Examples
// Create settings for SRTP encryption with AES-128 and 80-bit auth tag
var settings = new SRTPSettings
{
Key = "000102030405060708090A0B0C0D0E0F", // 16 bytes for AES-128
Cipher = SRTPCipher.AES_128_ICM,
Auth = SRTPAuth.HMAC_SHA1_80
};
Remarks
This class encapsulates all necessary parameters for SRTP encryption/decryption, including the master key, master salt, and cipher/authentication suites.
SRTP uses AES encryption in Counter Mode (AES-CM) combined with HMAC-SHA1 authentication to secure RTP media streams. The settings support multiple key sizes and authentication tag lengths as defined in RFC 3711.
Constructors
SRTPSettings()
Initializes a new instance of the VisioForge.Core.Types.X.Special.SRTPSettings class with default settings.
public SRTPSettings()Remarks
Creates SRTP settings with AES-128-ICM cipher and HMAC-SHA1-80 authentication, which are the most commonly used settings for SRTP as defined in RFC 3711.
SRTPSettings(string)
Initializes a new instance of the VisioForge.Core.Types.X.Special.SRTPSettings class with the specified key.
public SRTPSettings(string key)Parameters
keystring-
The SRTP master key as a hexadecimal string. Length must match the cipher requirements: 32 hex characters for AES-128-ICM, or 64 hex characters for AES-256-ICM.
Examples
// Create settings for SRTP encryption
var settings = new SRTPSettings("000102030405060708090A0B0C0D0E0F");
// Optionally change to AES-256
settings.Cipher = SRTPCipher.AES_256_ICM;
settings.Key = "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F";
Remarks
The constructor sets the default cipher to AES-128-ICM and authentication to HMAC-SHA1-80. Change the VisioForge.Core.Types.X.Special.SRTPSettings.Cipher and VisioForge.Core.Types.X.Special.SRTPSettings.Auth properties after construction if different settings are required.
Properties
Auth
Gets or sets the SRTP authentication method for message authentication and integrity.
public SRTPAuth Auth { get; set; }Property Value
Remarks
Determines the authentication algorithm and tag length: - HMAC_SHA1_80: HMAC-SHA1 with 80-bit authentication tag (recommended for RTP) - HMAC_SHA1_32: HMAC-SHA1 with 32-bit authentication tag (lower overhead) - NULL: No authentication (not recommended for production)
The 80-bit tag provides strong authentication suitable for most applications, while the 32-bit tag reduces bandwidth overhead for constrained networks.
Cipher
Gets or sets the SRTP cipher suite to use for encryption.
public SRTPCipher Cipher { get; set; }Property Value
Remarks
Determines the encryption algorithm and key size: - AES_128_ICM: AES-128 in Counter Mode (most common, good performance) - AES_256_ICM: AES-256 in Counter Mode (maximum security) - NULL: No encryption (authentication only)
Counter Mode (ICM/CTR) provides efficient stream encryption suitable for real-time media.
Key
Gets or sets the SRTP master key as a hexadecimal string.
public string Key { get; set; }Property Value
Remarks
The key length must match the selected cipher: - AES_128_ICM: 32 hex characters (16 bytes) - AES_256_ICM: 64 hex characters (32 bytes) - NULL: 0 characters (no encryption)
This master key is used to derive the SRTP session encryption key through the SRTP Key Derivation Function (KDF) as specified in RFC 3711.
Example: "000102030405060708090A0B0C0D0E0F" for AES-128
SSRC
Gets or sets the RTP SSRC (Synchronization Source) value for SRTP context.
public uint SSRC { get; set; }Property Value
Remarks
The SSRC identifies the source of an RTP stream. In SRTP, each SSRC can have its own encryption context. Setting this to 0 allows the element to work with any SSRC value.
For multi-stream scenarios, specific SSRC values can be configured to apply different encryption contexts to different streams.