Beispiel #1
0
 public SrtcpTransformer(SrtpTransformEngine forwardEngine, SrtpTransformEngine reverseEngine)
 {
     this.packet        = new RawPacket();
     this.forwardEngine = forwardEngine;
     this.reverseEngine = reverseEngine;
     this.contexts      = new ConcurrentDictionary <long, SrtcpCryptoContext>();
 }
Beispiel #2
0
        private IPacketTransformer GenerateTransformer(SDPSecurityDescription securityDescription, bool isRtp)
        {
            var srtpParams = SrtpParameters.GetSrtpParametersForProfile((int)securityDescription.CryptoSuite);

            var engine = new SrtpTransformEngine(securityDescription.KeyParams[0].Key,
                                                 securityDescription.KeyParams[0].Salt,
                                                 srtpParams.GetSrtpPolicy(),
                                                 srtpParams.GetSrtcpPolicy());

            if (isRtp)
            {
                return(engine.GetRTPTransformer());
            }
            else
            {
                return(engine.GetRTCPTransformer());
            }
        }
        protected IPacketTransformer GenerateTransformer(bool isClient, bool isRtp)
        {
            SrtpTransformEngine engine = null;

            if (!isClient)
            {
                engine = new SrtpTransformEngine(GetMasterServerKey(), GetMasterServerSalt(), GetSrtpPolicy(), GetSrtcpPolicy());
            }
            else
            {
                engine = new SrtpTransformEngine(GetMasterClientKey(), GetMasterClientSalt(), GetSrtpPolicy(), GetSrtcpPolicy());
            }

            if (isRtp)
            {
                return(engine.GetRTPTransformer());
            }
            else
            {
                return(engine.GetRTCPTransformer());
            }
        }
Beispiel #4
0
 public SrtcpTransformer(SrtpTransformEngine engine) : this(engine, engine)
 {
 }