Пример #1
0
        public MedikitCertificate GetIdAuthCertificate()
        {
            var certs = _certificateStore.GetIdentityCertificates();
            var identityCertificate = _certificateStore.GetIdentityCertificates().Result.FirstOrDefault(_ => _.IsSelected);

            if (identityCertificate == null)
            {
                return(null);
            }

            return(GetCertificate(Convert.FromBase64String(identityCertificate.Payload), new Regex(AUTHENTICATION_CERT_NAME), identityCertificate.Password));
        }
Пример #2
0
        private async Task Load()
        {
            IsBusy = true;
            var certificates = await _certificateStore.GetIdentityCertificates();

            Certificates.Clear();
            foreach (var certificate in certificates)
            {
                var record = new CertificateViewModel
                {
                    IsSelected     = false,
                    Name           = certificate.Name,
                    CreateDateTime = certificate.CreateDateTime
                };
                Certificates.Add(record);
                if (certificate.IsSelected)
                {
                    ActiveCertificate = record;
                }
            }

            ((Command)DeleteCertificateCommand).ChangeCanExecute();
            IsBusy = false;
        }