public static ClientCertificateParameters GetDefaultParameters()
        {
            var defaultParameters = new ClientCertificateParameters();

            defaultParameters.EnsureDefaultValues();
            return(defaultParameters);
        }
		public async void HelloClient ()
		{
			RequireMonoClient ();

			var certParams = new ClientCertificateParameters ();
			certParams.SignatureAndHashAlgorithms.Add (new SignatureAndHashAlgorithm (HashAlgorithmType.Sha512, SignatureAlgorithmType.Rsa));
			certParams.EnsureDefaultValues ();

			var parameters = new MonoClientAndServerParameters {
				RequireClientCertificate = true, ClientCertificate = ResourceManager.MonkeyCertificate,
				TrustedCA = ResourceManager.LocalCACertificate, VerifyPeerCertificate = true,
				ClientCertificateParameters = certParams
			};

			parameters.ClientInstrumentation.Add (NegotiationState.ServerHello, c => new ServerHelloHandler (c));

			await Run (parameters);
		}
Пример #3
0
        public virtual ClientCertificateParameters GetServerCertificateParameters(ITlsContext ctx)
        {
            if (!ctx.IsServer)
            {
                throw new InvalidOperationException();
            }

            if (ctx.HasClientCertificateParameters)
            {
                return(ctx.ClientCertificateParameters);
            }

            if (ctx.SettingsProvider.HasClientCertificateParameters)
            {
                var parameters = ctx.SettingsProvider.ClientCertificateParameters;
                if (parameters != null)
                {
                    return(parameters);
                }
            }

            return(ClientCertificateParameters.GetDefaultParameters());
        }
		public static ClientCertificateParameters GetDefaultParameters ()
		{
			var defaultParameters = new ClientCertificateParameters ();
			defaultParameters.EnsureDefaultValues ();
			return defaultParameters;
		}
			protected override TlsCertificateRequest GenerateCertificateRequest ()
			{
				var parameters = new ClientCertificateParameters ();
				parameters.CertificateTypes.Add (ClientCertificateType.RsaFixedDh);
				DebugHelper.WriteLine ("CERTIFICATE REQUEST");
				parameters.SignatureAndHashAlgorithms.Add (new SignatureAndHashAlgorithm (HashAlgorithmType.Md5, SignatureAlgorithmType.ECDsa));
				parameters.CertificateAuthorities.Add ("CN=NotExisting");
				return new TlsCertificateRequest (parameters);
			}