Class DtlsControlImpl
- java.lang.Object
-
- org.jitsi.service.neomedia.AbstractSrtpControl<DtlsTransformEngine>
-
- org.jitsi.impl.neomedia.transform.dtls.DtlsControlImpl
-
- All Implemented Interfaces:
DtlsControl,SrtpControl
public class DtlsControlImpl extends AbstractSrtpControl<DtlsTransformEngine> implements DtlsControl
ImplementsDtlsControli.e.SrtpControlfor DTLS-SRTP.- Author:
- Lyubomir Marinov
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jitsi.service.neomedia.DtlsControl
DtlsControl.Setup
-
Nested classes/interfaces inherited from interface org.jitsi.service.neomedia.SrtpControl
SrtpControl.TransformEngine
-
-
Field Summary
Fields Modifier and Type Field Description static longCERT_CACHE_EXPIRE_TIMEThe certificate cache expiration time to use, in milliseconds.static StringCERT_CACHE_EXPIRE_TIME_PNAMEThe name of the property to specify DTLS certificate cache expiration.static longDEFAULT_CERT_CACHE_EXPIRE_TIMEThe default certificate cache expiration time, when config properties are not found.static intDEFAULT_RSA_KEY_SIZEThe default RSA key size when configuration properties are not found.static intDEFAULT_RSA_KEY_SIZE_CERTAINTYThe default RSA key size certainty when config properties are not found.static StringPROP_SIGNATURE_ALGORITHMThe name of the property which specifies the signature algorithm used during certificate creation.static BigIntegerRSA_KEY_PUBLIC_EXPONENTThe public exponent to always use for RSA key generation.static intRSA_KEY_SIZEThe RSA key size to use.static intRSA_KEY_SIZE_CERTAINTYThe RSA key size certainty to use.static StringRSA_KEY_SIZE_CERTAINTY_PNAMEThe name of the property to specify RSA key size certainty.static StringRSA_KEY_SIZE_PNAMEThe name of the property to specify RSA Key length.-
Fields inherited from class org.jitsi.service.neomedia.AbstractSrtpControl
transformEngine
-
Fields inherited from interface org.jitsi.service.neomedia.DtlsControl
UDP_TLS_RTP_SAVP, UDP_TLS_RTP_SAVPF
-
Fields inherited from interface org.jitsi.service.neomedia.SrtpControl
RTP_SAVP, RTP_SAVPF
-
-
Constructor Summary
Constructors Constructor Description DtlsControlImpl()Initializes a new DtlsControlImpl instance.DtlsControlImpl(boolean srtpDisabled)Initializes a new DtlsControlImpl instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected DtlsTransformEnginecreateTransformEngine()Initializes a new DtlsTransformEngine instance to be associated with and used by this DtlsControlImpl instance.protected voiddoCleanup()Prepares thisSrtpControlfor garbage collection.StringgetLocalFingerprint()Gets the fingerprint of the local certificate that this instance uses to authenticate its ends of DTLS sessions.StringgetLocalFingerprintHashFunction()Gets the hash function with which the fingerprint of the local certificate is computed i.e.booleangetSecureCommunicationStatus()Gets the default secure/insecure communication status for the supported call sessions.DtlsControl.SetupgetSetup()Gets the value of thesetupSDP attribute defined by RFC 4145 "TCP-Based Media Transport in the Session Description Protocol (SDP)" which determines whether this instance acts as a DTLS client or a DTLS server.booleanrequiresSecureSignalingTransport()Indicates if the key exchange method is dependent on secure transport of the signaling channel.voidsetConnector(AbstractRTPConnector connector)Sets the RTPConnector which is to use or uses this SRTP engine.voidsetRemoteFingerprints(Map<String,String> remoteFingerprints)Sets the certificate fingerprints presented by the remote endpoint via the signaling path.voidsetRtcpmux(boolean rtcpmux)Enables/disables rtcp-mux.voidsetSetup(DtlsControl.Setup setup)Sets the value of the setup SDP attribute defined by RFC 4145 "TCP-Based Media Transport in the Session Description Protocol (SDP)" which determines whether this instance is to act as a DTLS client or a DTLS server.voidstart(org.jitsi.utils.MediaType mediaType)Starts and enables zrtp in the stream holding this control.-
Methods inherited from class org.jitsi.service.neomedia.AbstractSrtpControl
cleanup, getSrtpControlType, getSrtpListener, getTransformEngine, registerUser, setMasterSession, setMultistream, setSrtpListener
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jitsi.service.neomedia.SrtpControl
cleanup, getSrtpControlType, getSrtpListener, getTransformEngine, registerUser, setMasterSession, setMultistream, setSrtpListener
-
-
-
-
Field Detail
-
PROP_SIGNATURE_ALGORITHM
public static final String PROP_SIGNATURE_ALGORITHM
The name of the property which specifies the signature algorithm used during certificate creation. When a certificate is created and this property is not set, a default value of "SHA1withRSA" will be used.- See Also:
- Constant Field Values
-
RSA_KEY_SIZE_PNAME
public static final String RSA_KEY_SIZE_PNAME
The name of the property to specify RSA Key length.- See Also:
- Constant Field Values
-
DEFAULT_RSA_KEY_SIZE
public static final int DEFAULT_RSA_KEY_SIZE
The default RSA key size when configuration properties are not found.- See Also:
- Constant Field Values
-
RSA_KEY_SIZE
public static final int RSA_KEY_SIZE
The RSA key size to use. The default value isDEFAULT_RSA_KEY_SIZEbut may be overridden by theConfigurationServiceand/orSystempropertyRSA_KEY_SIZE_PNAME.
-
RSA_KEY_SIZE_CERTAINTY_PNAME
public static final String RSA_KEY_SIZE_CERTAINTY_PNAME
The name of the property to specify RSA key size certainty. https://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html- See Also:
- Constant Field Values
-
RSA_KEY_SIZE_CERTAINTY
public static final int RSA_KEY_SIZE_CERTAINTY
The RSA key size certainty to use. The default value isDEFAULT_RSA_KEY_SIZE_CERTAINTYbut may be overridden by theConfigurationServiceand/orSystempropertyRSA_KEY_SIZE_CERTAINTY_PNAME. For more on certainty, look at the three parameter constructor here: https://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html
-
DEFAULT_RSA_KEY_SIZE_CERTAINTY
public static final int DEFAULT_RSA_KEY_SIZE_CERTAINTY
The default RSA key size certainty when config properties are not found.- See Also:
- Constant Field Values
-
CERT_CACHE_EXPIRE_TIME_PNAME
public static final String CERT_CACHE_EXPIRE_TIME_PNAME
The name of the property to specify DTLS certificate cache expiration.- See Also:
- Constant Field Values
-
CERT_CACHE_EXPIRE_TIME
public static final long CERT_CACHE_EXPIRE_TIME
The certificate cache expiration time to use, in milliseconds. The default value isDEFAULT_CERT_CACHE_EXPIRE_TIMEbut may be overridden by theConfigurationServiceand/orSystempropertyCERT_CACHE_EXPIRE_TIME_PNAME.
-
DEFAULT_CERT_CACHE_EXPIRE_TIME
public static final long DEFAULT_CERT_CACHE_EXPIRE_TIME
The default certificate cache expiration time, when config properties are not found.- See Also:
- Constant Field Values
-
RSA_KEY_PUBLIC_EXPONENT
public static final BigInteger RSA_KEY_PUBLIC_EXPONENT
The public exponent to always use for RSA key generation.
-
-
Constructor Detail
-
DtlsControlImpl
public DtlsControlImpl()
Initializes a new DtlsControlImpl instance.
-
DtlsControlImpl
public DtlsControlImpl(boolean srtpDisabled)
Initializes a new DtlsControlImpl instance.- Parameters:
srtpDisabled- true if pure DTLS mode without SRTP extensions is to be used; otherwise, false
-
-
Method Detail
-
createTransformEngine
protected DtlsTransformEngine createTransformEngine()
Initializes a new DtlsTransformEngine instance to be associated with and used by this DtlsControlImpl instance. The method is implemented as a factory.- Specified by:
createTransformEnginein classAbstractSrtpControl<DtlsTransformEngine>- Returns:
- a new DtlsTransformEngine instance to be associated with and used by this DtlsControlImpl instance
-
doCleanup
protected void doCleanup()
Prepares thisSrtpControlfor garbage collection.- Overrides:
doCleanupin classAbstractSrtpControl<DtlsTransformEngine>
-
getLocalFingerprint
public String getLocalFingerprint()
Gets the fingerprint of the local certificate that this instance uses to authenticate its ends of DTLS sessions.- Specified by:
getLocalFingerprintin interfaceDtlsControl- Returns:
- the fingerprint of the local certificate that this instance uses to authenticate its ends of DTLS sessions
-
getLocalFingerprintHashFunction
public String getLocalFingerprintHashFunction()
Gets the hash function with which the fingerprint of the local certificate is computed i.e. the digest algorithm of the signature algorithm of the local certificate.- Specified by:
getLocalFingerprintHashFunctionin interfaceDtlsControl- Returns:
- the hash function with which the fingerprint of the local certificate is computed
-
getSecureCommunicationStatus
public boolean getSecureCommunicationStatus()
Gets the default secure/insecure communication status for the supported call sessions.- Specified by:
getSecureCommunicationStatusin interfaceSrtpControl- Returns:
- default secure communication status for the supported call sessions.
-
getSetup
public DtlsControl.Setup getSetup()
Gets the value of thesetupSDP attribute defined by RFC 4145 "TCP-Based Media Transport in the Session Description Protocol (SDP)" which determines whether this instance acts as a DTLS client or a DTLS server.- Specified by:
getSetupin interfaceDtlsControl- Returns:
- the value of the
setupSDP attribute defined by RFC 4145 "TCP-Based Media Transport in the Session Description Protocol (SDP)" which determines whether this instance acts as a DTLS client or a DTLS server
-
requiresSecureSignalingTransport
public boolean requiresSecureSignalingTransport()
Indicates if the key exchange method is dependent on secure transport of the signaling channel. The implementation of DtlsControlImpl always returns true.- Specified by:
requiresSecureSignalingTransportin interfaceSrtpControl- Returns:
- true when secure signaling is required to make the encryption secure; false, otherwise.
-
setConnector
public void setConnector(AbstractRTPConnector connector)
Sets the RTPConnector which is to use or uses this SRTP engine.- Specified by:
setConnectorin interfaceSrtpControl- Parameters:
connector- the RTPConnector which is to use or uses this SRTP engine
-
setRemoteFingerprints
public void setRemoteFingerprints(Map<String,String> remoteFingerprints)
Sets the certificate fingerprints presented by the remote endpoint via the signaling path.- Specified by:
setRemoteFingerprintsin interfaceDtlsControl- Parameters:
remoteFingerprints- a Map of hash functions to certificate fingerprints that have been presented by the remote endpoint via the signaling path
-
setRtcpmux
public void setRtcpmux(boolean rtcpmux)
Enables/disables rtcp-mux.- Specified by:
setRtcpmuxin interfaceDtlsControl- Parameters:
rtcpmux- whether to enable or disable.
-
setSetup
public void setSetup(DtlsControl.Setup setup)
Sets the value of the setup SDP attribute defined by RFC 4145 "TCP-Based Media Transport in the Session Description Protocol (SDP)" which determines whether this instance is to act as a DTLS client or a DTLS server.- Specified by:
setSetupin interfaceDtlsControl- Parameters:
setup- the value of the setup SDP attribute to set on this instance in order to determine whether this instance is to act as a DTLS client or a DTLS server
-
start
public void start(org.jitsi.utils.MediaType mediaType)
Starts and enables zrtp in the stream holding this control.- Specified by:
startin interfaceSrtpControl- Parameters:
mediaType- the media type of the stream this control controls.
-
-