Example #1
0
            public async Task <ViewModel> Handle(Query query, CancellationToken cancellationToken)
            {
                var viewModel = new ViewModel();

                viewModel.ValidationResult = queryValidator.Validate(query);
                if (!viewModel.ValidationResult.IsValid)
                {
                    return(viewModel);
                }

                viewModel.AuthorityCertificates = await privateCertRepository.GetValidAuthorityCertificatesAsync();

                viewModel.SelectedAuthorityCertificateId = viewModel.AuthorityCertificates.First().CertificateId;
                viewModel.ExpirationDateInDays           = 720;
                viewModel.SubjectName = "Signer or Bob";

                return(viewModel);
            }
Example #2
0
            public async Task <ViewModel> Handle(Query request, CancellationToken cancellationToken)
            {
                var viewModel = new ViewModel();

                viewModel.ValidationResult = await queryValidator.ValidateAsync(request, cancellationToken);

                if (!viewModel.ValidationResult.IsValid)
                {
                    return(viewModel);
                }

                viewModel.AuthorityCertificates = await privateCertRepository.GetValidAuthorityCertificatesAsync();

                viewModel.SelectedAuthorityCertificateId = viewModel.AuthorityCertificates.First().CertificateId;
                viewModel.ExpirationDateInDays           = 720;
                viewModel.SubjectName = "some.domain.com or *.domain.com";

                return(viewModel);
            }