Class DtlsSrtpServer
Class for a DTLS-SRTP handshake server
Inherited Members
Namespace: SipLib.Dtls
Assembly: SipLib.dll
Syntax
public class DtlsSrtpServer : DefaultTlsServer, TlsServer, TlsPeer, IDtlsSrtpPeer
Constructors
| Edit this page View SourceDtlsSrtpServer()
Constructor. Creates a self-signed certificate.
Declaration
public DtlsSrtpServer()
DtlsSrtpServer(Certificate, AsymmetricKeyParameter)
Constructor
Declaration
public DtlsSrtpServer(Certificate certificateChain, AsymmetricKeyParameter privateKey)
Parameters
Type | Name | Description |
---|---|---|
Certificate | certificateChain | Contains at least one X.509 certificate. If null, then a self-signed certificate will be automatically created. |
AsymmetricKeyParameter | privateKey | Private key for the certificate |
DtlsSrtpServer(X509Certificate2)
Constructor
Declaration
public DtlsSrtpServer(X509Certificate2 certificate)
Parameters
Type | Name | Description |
---|---|---|
X509Certificate2 | certificate | The .NET X509Certificate2 to use |
DtlsSrtpServer(string, string)
Constructor
Declaration
public DtlsSrtpServer(string certificatePath, string keyPath)
Parameters
Type | Name | Description |
---|---|---|
string | certificatePath | The file path to the certificate |
string | keyPath | The file path to the private key |
DtlsSrtpServer(string[], string)
Constructor
Declaration
public DtlsSrtpServer(string[] certificatesPath, string keyPath)
Parameters
Type | Name | Description |
---|---|---|
string[] | certificatesPath | File paths to the certificates |
string | keyPath | File path to the private key |
Properties
| Edit this page View SourceCertificateChain
Gets the certificate change containing the certificate
Declaration
public Certificate? CertificateChain { get; }
Property Value
Type | Description |
---|---|
Certificate |
ClientCertificate
Gets the client's X.509 certificate
Declaration
public Certificate? ClientCertificate { get; }
Property Value
Type | Description |
---|---|
Certificate |
Fingerprint
Gets the fingerprint for the certificate.
Declaration
public RTCDtlsFingerprint? Fingerprint { get; }
Property Value
Type | Description |
---|---|
RTCDtlsFingerprint |
ForceUseExtendedMasterSecret
Gets or sets a flag to indicate whether or not to force the use of the extended MasterSecret. Defaults to true.
Declaration
public bool ForceUseExtendedMasterSecret { get; set; }
Property Value
Type | Description |
---|---|
bool |
MaximumVersion
Gets the maximum supported DTLS protocol version
Declaration
protected override ProtocolVersion MaximumVersion { get; }
Property Value
Type | Description |
---|---|
ProtocolVersion |
Overrides
MinimumVersion
Gets the minimum supported DTLS version
Declaration
protected override ProtocolVersion MinimumVersion { get; }
Property Value
Type | Description |
---|---|
ProtocolVersion |
Overrides
PrivateKey
Gets the private key for the certificate.
Declaration
public AsymmetricKeyParameter? PrivateKey { get; }
Property Value
Type | Description |
---|---|
AsymmetricKeyParameter |
Methods
| Edit this page View SourceGetCertificateRequest()
Gets the certificate request
Declaration
public override CertificateRequest GetCertificateRequest()
Returns
Type | Description |
---|---|
CertificateRequest |
Overrides
GetCipherSuites()
Gets the cipher suites supported by the server
Declaration
protected override int[] GetCipherSuites()
Returns
Type | Description |
---|---|
int[] |
Overrides
GetECDsaSignerCredentials()
Gets the ECDSA certificate signer's credentials
Declaration
protected override TlsSignerCredentials GetECDsaSignerCredentials()
Returns
Type | Description |
---|---|
TlsSignerCredentials |
Overrides
GetKeyingMaterial(int)
Gets the keying material (master keys and master salts)
Declaration
protected byte[] GetKeyingMaterial(int length)
Parameters
Type | Name | Description |
---|---|---|
int | length |
Returns
Type | Description |
---|---|
byte[] |
GetKeyingMaterial(string, byte[], int)
Gets the keying material (master keys and master salts)
Declaration
protected virtual byte[] GetKeyingMaterial(string asciiLabel, byte[] context_value, int length)
Parameters
Type | Name | Description |
---|---|---|
string | asciiLabel | |
byte[] | context_value | |
int | length |
Returns
Type | Description |
---|---|
byte[] |
Exceptions
Type | Condition |
---|---|
ArgumentException | |
InvalidOperationException |
GetRemoteCertificate()
Gets the client's Certificate
Declaration
public Certificate GetRemoteCertificate()
Returns
Type | Description |
---|---|
Certificate |
GetRsaEncryptionCredentials()
Gets the RSA certificate encryption credentials
Declaration
protected override TlsEncryptionCredentials GetRsaEncryptionCredentials()
Returns
Type | Description |
---|---|
TlsEncryptionCredentials |
Overrides
GetRsaSignerCredentials()
Gets the RSA certificate signer's credentials
Declaration
protected override TlsSignerCredentials GetRsaSignerCredentials()
Returns
Type | Description |
---|---|
TlsSignerCredentials |
Overrides
GetSelectedCipherSuite()
Gets the cipher suite ID that was selected.
Declaration
public override int GetSelectedCipherSuite()
Returns
Type | Description |
---|---|
int |
Overrides
GetServerExtensions()
Gets the server's DTLS extensions
Declaration
public override IDictionary GetServerExtensions()
Returns
Type | Description |
---|---|
IDictionary |
Overrides
GetSrtcpPolicy()
Gets the SRTCP encryption and authenticaion policy information for the DTLS-SRTP session
Declaration
public SrtpPolicy GetSrtcpPolicy()
Returns
Type | Description |
---|---|
SrtpPolicy |
GetSrtpMasterClientKey()
Gets the client's master SRTP key
Declaration
public byte[] GetSrtpMasterClientKey()
Returns
Type | Description |
---|---|
byte[] |
GetSrtpMasterClientSalt()
Gets the client's master salt
Declaration
public byte[] GetSrtpMasterClientSalt()
Returns
Type | Description |
---|---|
byte[] |
GetSrtpMasterServerKey()
Gets the server's master key for SRTP
Declaration
public byte[] GetSrtpMasterServerKey()
Returns
Type | Description |
---|---|
byte[] |
GetSrtpMasterServerSalt()
Gets the server's master salt for SRTP
Declaration
public byte[] GetSrtpMasterServerSalt()
Returns
Type | Description |
---|---|
byte[] |
GetSrtpPolicy()
Gets the SRTP encryption and authentication policy information for the DTLS-SRTP session
Declaration
public SrtpPolicy GetSrtpPolicy()
Returns
Type | Description |
---|---|
SrtpPolicy |
IsClient()
Always returns false because this object is the DTLS server
Declaration
public bool IsClient()
Returns
Type | Description |
---|---|
bool |
NotifyAlertRaised(byte, byte, string, Exception)
Called by the transport if a DTLS-SRTP protocol alert has been raised.
Declaration
public override void NotifyAlertRaised(byte alertLevel, byte alertDescription, string message, Exception cause)
Parameters
Type | Name | Description |
---|---|---|
byte | alertLevel | |
byte | alertDescription | |
string | message | |
Exception | cause |
Overrides
| Edit this page View SourceNotifyAlertReceived(byte, byte)
Called if a protocol Alert was received
Declaration
public override void NotifyAlertReceived(byte alertLevel, byte alertDescription)
Parameters
Type | Name | Description |
---|---|---|
byte | alertLevel | |
byte | alertDescription |
Overrides
| Edit this page View SourceNotifyClientCertificate(Certificate)
Called when the client certificate has been received during the handshake
Declaration
public override void NotifyClientCertificate(Certificate clientCertificate)
Parameters
Type | Name | Description |
---|---|---|
Certificate | clientCertificate |
Overrides
NotifyHandshakeComplete()
Called when the DTLS handshake is completed
Declaration
public override void NotifyHandshakeComplete()
Overrides
NotifySecureRenegotiation(bool)
This override prevents a TLS fault from being generated if a "Client Hello" is received that does not support TLS renegotiation (https://tools.ietf.org/html/rfc5746). This override is required to be able to complete a DTLS handshake with the Pion WebRTC library, see https://github.com/pion/dtls/issues/274.
Declaration
public override void NotifySecureRenegotiation(bool secureRenegotiation)
Parameters
Type | Name | Description |
---|---|---|
bool | secureRenegotiation |
Overrides
| Edit this page View SourcePrepareSrtpSharedSecret()
Prepares the SRTP-DTLS shared secret for the DTLS-SRTP handshake
Declaration
protected virtual void PrepareSrtpSharedSecret()
ProcessClientExtensions(IDictionary)
Called to process the client's DTLS protocol externsions when they are received.
Declaration
public override void ProcessClientExtensions(IDictionary clientExtensions)
Parameters
Type | Name | Description |
---|---|---|
IDictionary | clientExtensions | The client's extensions |
Overrides
| Edit this page View SourceRequiresExtendedMasterSecret()
Returns true if an extended master secret is required.
Declaration
public override bool RequiresExtendedMasterSecret()
Returns
Type | Description |
---|---|
bool |
Overrides
Events
| Edit this page View SourceOnAlert
This event is fired if an Alert message was received during the DTLS protocol handshake
Declaration
public event Action<AlertLevelsEnum, AlertTypesEnum, string>? OnAlert
Event Type
Type | Description |
---|---|
Action<AlertLevelsEnum, AlertTypesEnum, string> |