void NewCertificate(object o)
        {
            var errors = ValidateInputs();

            if (!errors.ToString().IsNullOrEmpty())
            {
                MessageBoxContent = new MessageBoxViewModel(CloseMessageBox,
                                                            MessageBoxModel.Error("Errors generating Certificate - " +
                                                                                  Environment.NewLine +
                                                                                  errors.ToString()));
                IsMessageBoxVisible = true;
                return;
            }
            var keygen  = KeyPairUtils.CreateGenerator(Repository.Srand, Model.KeyPairGenerator, Model.KeyStrength);
            var keypair = keygen.GenerateKeyPair();
            //load the ca pfx file
            var caStore = X509Utils.LoadCAPfx(Repository.Instance.KeyStorePassword);
            var caCert  = caStore.GetCertificate("ca").Certificate;
            var caKey   = caStore.GetKey("ca").Key;
            var cert    = X509Utils.GenerateUserCertificate(Model.X509Name,
                                                            caCert.SubjectDN,
                                                            Model.Validity,
                                                            keypair.Public,
                                                            caKey,
                                                            Model.SignatureAlgorithm,
                                                            KeyUsageUtils.GetKeyUsage(Model.KeyUsages),
                                                            Model.ExtendedKeyUsages == null
                                                             ? null
                                                             : new ExtendedKeyUsage(
                                                                KeyUsageUtils.GetExtendedKeyUsages(
                                                                    Model.ExtendedKeyUsages)));

            _newCertCompletedAction.Invoke(Model.CommonName, cert, keypair);
        }