Class CryptoContext
Class for storing the settings and status of the cryptographic context for SRTP and SRTCP.
Inherited Members
Namespace: SipLib.RtpCrypto
Assembly: SipLib.dll
Syntax
public class CryptoContext
Constructors
| Edit this page View SourceCryptoContext(string)
Creates a new CryptoContext object with a single MasterKey. Use this constructor when building a SRTP crypto context for sending SRTP and SRTCP packets.
Declaration
public CryptoContext(string cryptoSuite)
Parameters
| Type | Name | Description |
|---|---|---|
| string | cryptoSuite | Specifies the name of the crypto suite to use. |
Fields
| Edit this page View SourceAuthTagLength
Specifies the length in bytes of the packet authentication tag that is appended to each RTP or RTCP packet. Will be equal to 10 or 4 depending upon the crypto suite being used.
Declaration
public int AuthTagLength
Field Value
| Type | Description |
|---|---|
| int |
CurrentRtcpMasterKeyIndex
Index of the current maser key in the MasterKeys list for RTCP.
Declaration
public int CurrentRtcpMasterKeyIndex
Field Value
| Type | Description |
|---|---|
| int |
CurrentRtpMasterKeyIndex
Index of the current master key in the MasterKeys list for RTP.
Declaration
public int CurrentRtpMasterKeyIndex
Field Value
| Type | Description |
|---|---|
| int |
HighestSeq
Highest received RTP sequence number. This value is the s_l variable in Section 3.3.1 of RFC 3711. This is used by the receiver only.
Declaration
public ushort HighestSeq
Field Value
| Type | Description |
|---|---|
| ushort |
MasterKeys
Contains the master keys and master salts used for this crypto context. Will contain at least one entry.
Declaration
public List<MasterKeys> MasterKeys
Field Value
| Type | Description |
|---|---|
| List<MasterKeys> |
MaxSendRtcpIndex
Maximum RTCP Index value. 2^31 - 1 because only 31 bits of the RTCP index are used, the MS bit is used to indicate encryption.
Declaration
public const uint MaxSendRtcpIndex = 2147483647
Field Value
| Type | Description |
|---|---|
| uint |
MkiIndicator
If true, then each SRTP or SRTCP packet will be appended by a Master Key Indentifier (MKI) value that identifies the master encryption key used for that packet. If false, then no MKI will be attached to the packets.
Declaration
public bool MkiIndicator
Field Value
| Type | Description |
|---|---|
| bool |
MkiLength
Specifies the length in bytes of the MKI attached to each SRTP or SRTCP packet. Used only if MkiIndicator is true.
Declaration
public int MkiLength
Field Value
| Type | Description |
|---|---|
| int |
ROC
Current Roll Over Counter (ROC) values. The ROC represents the number of times that the SEQ number of the SRTP packets has been reset to 0. The ROC is not used for RTCP.
Declaration
public RocVals ROC
Field Value
| Type | Description |
|---|---|
| RocVals |
RtcpSessionKeys
Stores the current session keys (key, salt and auth. key) for SRTCP.
Declaration
public SessionKeys RtcpSessionKeys
Field Value
| Type | Description |
|---|---|
| SessionKeys |
RtpSessionKeys
Stores the current session keys (key, salt and auth. key) for SRTP.
Declaration
public SessionKeys RtpSessionKeys
Field Value
| Type | Description |
|---|---|
| SessionKeys |
SendRtcpIndex
SRTP Index used for sending RTCP packets
Declaration
public uint SendRtcpIndex
Field Value
| Type | Description |
|---|---|
| uint |
Properties
| Edit this page View SourceCryptoSuite
Gets the crypto suite name used by this crypto context.
Declaration
public string CryptoSuite { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
| Edit this page View SourceCreateFromCryptoAttribute(CryptoAttribute)
Creates a new CryptoContext object from a CryptoAttribute object.
Declaration
public static CryptoContext CreateFromCryptoAttribute(CryptoAttribute attr)
Parameters
| Type | Name | Description |
|---|---|---|
| CryptoAttribute | attr | Input CryptoAttribute |
Returns
| Type | Description |
|---|---|
| CryptoContext | Returns a new CryptoContext object |
ToCryptoAttribute()
Converts this crypto context object into a CryptoAttribute object.
Declaration
public CryptoAttribute ToCryptoAttribute()
Returns
| Type | Description |
|---|---|
| CryptoAttribute | Returns a new CryptoAttribute object |