protected CipherInstrumentParameters(CipherInstrumentParameters other)
     : base(other)
 {
     Type = other.Type;
 }
 public CipherInstrumentParametersAttribute(CipherInstrumentType type)
     : base(null, TestFlags.Browsable | TestFlags.ContinueOnError)
 {
     Type = type;
 }
 public CipherInstrumentParameters(InstrumentationCategory category, CipherInstrumentType type, string identifier, X509Certificate certificate)
     : base(category, identifier, certificate)
 {
     Type = type;
 }
		public CipherInstrumentParameters (InstrumentationCategory category, CipherInstrumentType type, string identifier, IServerCertificate certificate)
			: base (category, identifier, certificate)
		{
			Type = type;
		}
		protected CipherInstrumentParameters (CipherInstrumentParameters other)
			: base (other)
		{
			Type = other.Type;
		}
		static CipherInstrumentParameters Create (TestContext ctx, InstrumentationCategory category, CipherInstrumentType type)
		{
			var parameters = CreateParameters (category, type);

			switch (type) {
			case CipherInstrumentType.InvalidCipher:
				parameters.ServerCiphers = new CipherSuiteCode[] { CipherSuiteCode.TLS_DHE_RSA_WITH_AES_128_CBC_SHA };
				parameters.ClientCiphers = new CipherSuiteCode[] { CipherSuiteCode.TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 };
				parameters.ProtocolVersion = ProtocolVersions.Tls12;
				parameters.ExpectServerAlert = AlertDescription.HandshakeFailure;
				break;

			default:
				ctx.AssertFail ("Unsupported cipher instrument: '{0}'.", type);
				break;
			}

			return parameters;
		}
		static CipherInstrumentParameters CreateParameters (InstrumentationCategory category, CipherInstrumentType type, params object[] args)
		{
			var sb = new StringBuilder ();
			sb.Append (type);
			foreach (var arg in args) {
				sb.AppendFormat (":{0}", arg);
			}
			var name = sb.ToString ();

			return new CipherInstrumentParameters (category, type, name, ResourceManager.SelfSignedServerCertificate) {
				ClientCertificateValidator = AcceptAnyCertificate, ServerCertificateValidator = AcceptAnyCertificate
			};
		}
		public CipherInstrumentParameters (InstrumentationCategory category, CipherInstrumentType type, ClientParameters clientParameters, ServerParameters serverParameters)
			: base (category, clientParameters, serverParameters)
		{
			Type = type;
		}
        static CipherInstrumentParameters Create(TestContext ctx, InstrumentationCategory category, CipherInstrumentType type)
        {
            var parameters = CreateParameters(category, type);

            switch (type)
            {
            case CipherInstrumentType.SelectClientCipher:
                parameters.ProtocolVersion    = ctx.GetParameter <ProtocolVersions> ();
                parameters.ClientCiphers      = new CipherSuiteCode[] { ctx.GetParameter <CipherSuiteCode> () };
                parameters.ValidateCipherList = true;
                break;

            case CipherInstrumentType.SelectServerCipher:
                parameters.ProtocolVersion    = ctx.GetParameter <ProtocolVersions> ();
                parameters.ServerCiphers      = new CipherSuiteCode[] { ctx.GetParameter <CipherSuiteCode> () };
                parameters.ValidateCipherList = true;
                break;

            case CipherInstrumentType.InvalidCipher:
                parameters.ServerCiphers     = new CipherSuiteCode[] { CipherSuiteCode.TLS_DHE_RSA_WITH_AES_128_CBC_SHA };
                parameters.ClientCiphers     = new CipherSuiteCode[] { CipherSuiteCode.TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 };
                parameters.ProtocolVersion   = ProtocolVersions.Tls12;
                parameters.ExpectServerAlert = AlertDescription.HandshakeFailure;
                break;

            default:
                ctx.AssertFail("Unsupported cipher instrument: '{0}'.", type);
                break;
            }

            return(parameters);
        }
        static CipherInstrumentParameters CreateParameters(InstrumentationCategory category, CipherInstrumentType type, params object[] args)
        {
            var sb = new StringBuilder();

            sb.Append(type);
            foreach (var arg in args)
            {
                sb.AppendFormat(":{0}", arg);
            }
            var name = sb.ToString();

            return(new CipherInstrumentParameters(category, type, name, ResourceManager.SelfSignedServerCertificate)
            {
                ClientCertificateValidator = AcceptAnyCertificate, ServerCertificateValidator = AcceptAnyCertificate
            });
        }