/// <summary>
 /// Loads the keystore from the <code>Repository.Instance.CertificatesKeyStore</code>
 /// You shud call <code>Repository.Instance.OpenExistingCertificateAuthority</code>
 /// before calling this.
 /// </summary>
 /// <param name="password">password for the keystore</param>
 public KeyStoreViewModel(char[] password, String path)
 {
     if (!Repository.Instance.OpenExistingCertificateAuthority(path, password))
     {
         throw new Exception("Unable to open KeyStore. Invalid keystore directory");
     }
     Name = Path.GetFileName(path);
     ReadOnlyKeyStore = false;
     _password = password;
     _listItems.Clear();
     var storeBuilder = new Pkcs12StoreBuilder();
     _store = storeBuilder.Build();
     _x509CertViewModel = new X509CertViewModel((alias, cert, keypair) =>
                                                    {
                                                        AddEntry(alias, cert, keypair);
                                                        ShowCertificateGenerator = false;
                                                    });
     Load();
 }
        /// <summary>
        /// Loads the keystore from the <code>Repository.Instance.CertificatesKeyStore</code>
        /// You shud call <code>Repository.Instance.OpenExistingCertificateAuthority</code>
        /// before calling this.
        /// </summary>
        /// <param name="password">password for the keystore</param>
        public KeyStoreViewModel(char[] password, String path)
        {
            if (!Repository.Instance.OpenExistingCertificateAuthority(path, password))
            {
                throw new Exception("Unable to open KeyStore. Invalid keystore directory");
            }
            Name             = Path.GetFileName(path);
            ReadOnlyKeyStore = false;
            _password        = password;
            _listItems.Clear();
            var storeBuilder = new Pkcs12StoreBuilder();

            _store             = storeBuilder.Build();
            _x509CertViewModel = new X509CertViewModel((alias, cert, keypair) =>
            {
                AddEntry(alias, cert, keypair);
                ShowCertificateGenerator = false;
            });
            Load();
        }